-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove Sync trait bounds on callback futures
They are unnecessary as we ever only retrieve the futures from ex data to poll them, thus when we have mutable access to them, so Send is all we need.
- Loading branch information
Showing
3 changed files
with
25 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
pub(crate) struct MutOnly<T>(T); | ||
|
||
impl<T> MutOnly<T> { | ||
pub(crate) fn new(value: T) -> Self { | ||
Self(value) | ||
} | ||
|
||
pub(crate) fn get_mut(&mut self) -> &mut T { | ||
&mut self.0 | ||
} | ||
} | ||
|
||
/// SAFETY: The type does not let anyone get a &T so Sync is irrelevant. | ||
unsafe impl<T> Sync for MutOnly<T> {} |