Skip to content

Commit

Permalink
uuid object created directly
Browse files Browse the repository at this point in the history
  • Loading branch information
Dylan-DPC committed Mar 20, 2018
1 parent afc61e9 commit d4c2963
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -705,8 +705,7 @@ impl Uuid {
/// ```
///
pub fn from_random_bytes(b: [u8; 16]) -> Uuid {
let mut uuid = Uuid { bytes: [0; 16] };
uuid.bytes.copy_from_slice(&b);
let mut uuid = Uuid { bytes: b };
uuid.set_variant(UuidVariant::RFC4122);
uuid.set_version(UuidVersion::Random);
uuid
Expand Down

0 comments on commit d4c2963

Please sign in to comment.