Skip to content

Commit

Permalink
Impl From<&mut AsciiStr>
Browse files Browse the repository at this point in the history
  • Loading branch information
tormol committed May 9, 2016
1 parent fc8a916 commit 4fbd050
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/ascii_str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,11 @@ macro_rules! impl_into {
unsafe{ mem::transmute(slice) }
}
}
impl<'a> From<&'a mut AsciiStr> for &'a mut $wider {
fn from(slice: &mut AsciiStr) -> &mut $wider {
unsafe{ mem::transmute(slice) }
}
}
impl From<Box<AsciiStr>> for Box<$wider> {
fn from(owned: Box<AsciiStr>) -> Box<$wider> {
unsafe{ mem::transmute(owned) }
Expand Down

0 comments on commit 4fbd050

Please sign in to comment.