Skip to content

Commit

Permalink
Fixed conversions on old versions of the compiler.
Browse files Browse the repository at this point in the history
`From<&'a [T]>` isn't implemented for `Box<[T]>` in older versions of
Rust.
  • Loading branch information
Kixunil committed Nov 10, 2017
1 parent 4b5b3a3 commit 5bad9c3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/database/bytes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,12 @@ impl AsMut<[u8]> for Bytes {

impl From<Bytes> for Vec<u8> {
fn from(bytes: Bytes) -> Self {
bytes.as_ref().into()
bytes.as_ref().to_owned()
}
}

impl From<Bytes> for Box<[u8]> {
fn from(bytes: Bytes) -> Self {
bytes.as_ref().into()
bytes.as_ref().to_owned().into_boxed_slice()
}
}

0 comments on commit 5bad9c3

Please sign in to comment.