Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F33297235
D14282.1768759474.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
609 B
Referenced Files
None
Subscribers
None
D14282.1768759474.diff
View Options
diff --git a/shared/comm-lib/src/tools.rs b/shared/comm-lib/src/tools.rs
--- a/shared/comm-lib/src/tools.rs
+++ b/shared/comm-lib/src/tools.rs
@@ -46,13 +46,17 @@
/// }
/// }
/// ```
-pub struct Defer<'s>(Option<Box<dyn FnOnce() + 's>>);
+pub struct Defer<'s>(Option<Box<dyn FnOnce() + 's + Send>>);
impl<'s> Defer<'s> {
- pub fn new(f: impl FnOnce() + 's) -> Self {
+ pub fn new(f: impl FnOnce() + 's + Send) -> Self {
Self(Some(Box::new(f)))
}
+ pub fn empty() -> Self {
+ Self(None)
+ }
+
/// Consumes the value, without calling the provided function
///
/// # Example
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Jan 18, 6:04 PM (7 h, 44 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5951898
Default Alt Text
D14282.1768759474.diff (609 B)
Attached To
Mode
D14282: [comm-lib] Add Send requirement for Defer closures
Attached
Detach File
Event Timeline
Log In to Comment