Skip to content

Commit

Permalink
Remove TryFrom import.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gaelan committed Jan 4, 2021
1 parent 0550c21 commit f93a2ad
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ mod v5;
#[cfg(all(windows, feature = "winapi"))]
mod winapi_support;

use crate::std::{convert::TryInto, fmt, str};
use crate::std::{convert, fmt, str};

pub use crate::error::Error;

Expand Down Expand Up @@ -390,7 +390,8 @@ impl Uuid {
let d3 =
u16::from(self.as_bytes()[6]) << 8 | u16::from(self.as_bytes()[7]);

let d4: &[u8; 8] = self.as_bytes()[8..16].try_into().unwrap();
let d4: &[u8; 8] =
convert::TryInto::try_into(&self.as_bytes()[8..16]).unwrap();
(d1, d2, d3, d4)
}

Expand Down Expand Up @@ -430,7 +431,8 @@ impl Uuid {
let d3 =
u16::from(self.as_bytes()[6]) | u16::from(self.as_bytes()[7]) << 8;

let d4: &[u8; 8] = self.as_bytes()[8..16].try_into().unwrap();
let d4: &[u8; 8] =
convert::TryInto::try_into(&self.as_bytes()[8..16]).unwrap();
(d1, d2, d3, d4)
}

Expand Down

0 comments on commit f93a2ad

Please sign in to comment.