-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add optional mutability to crypto layer (uses an unsafe hack)
Signed-off-by: Marc Schoolderman <[email protected]>
- Loading branch information
1 parent
e391e0e
commit 9437918
Showing
6 changed files
with
48 additions
and
19 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
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,17 @@ | ||
/// A little trait to support a limited form of 'mut polymorphism' | ||
pub trait FromMut<'a, T: ?Sized> { | ||
fn from_mut(x: &'a mut T) -> Self; | ||
} | ||
|
||
impl<'a, T: ?Sized> FromMut<'a, T> for &'a T { | ||
fn from_mut(x: &'a mut T) -> Self { | ||
x | ||
} | ||
} | ||
|
||
impl<'a, T: ?Sized> FromMut<'a, T> for &'a mut T { | ||
fn from_mut(x: &'a mut T) -> Self { | ||
x | ||
} | ||
} |
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