From 5a8235a341d45a5d2710cf9000eba8dfbac7714a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pascal=20St=C3=B6rzbach?= Date: Mon, 30 Oct 2023 20:30:14 +0100 Subject: [PATCH] Changed callback type to FnOnce --- msfs/src/network.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/msfs/src/network.rs b/msfs/src/network.rs index 53d3d6c015..129dbd82a5 100644 --- a/msfs/src/network.rs +++ b/msfs/src/network.rs @@ -7,7 +7,7 @@ use std::{ use crate::sys; -type NetworkCallback = Box; +type NetworkCallback = Box; /// A builder to build network requests pub struct NetworkRequestBuilder<'a> { @@ -41,7 +41,7 @@ impl<'a> NetworkRequestBuilder<'a> { /// Set a callback which will be called after the request finished or failed. /// The parameters are the network request and the http status code (negative if failed) - pub fn with_callback(mut self, callback: impl Fn(NetworkRequest, i32) + 'static) -> Self { + pub fn with_callback(mut self, callback: impl FnOnce(NetworkRequest, i32) + 'static) -> Self { self.callback = Some(Box::new(Box::new(callback))); self }