Page MenuHomePhorge

D14282.1768759474.diff
No OneTemporary

Size
609 B
Referenced Files
None
Subscribers
None

D14282.1768759474.diff

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

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)

Event Timeline