Skip to content

Commit

Permalink
better
Browse files Browse the repository at this point in the history
  • Loading branch information
a10y committed Sep 3, 2024
1 parent 3303175 commit 197807f
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,7 @@ impl Symbol {

/// Constructor for a `Symbol` from an 8-element byte slice.
pub fn from_slice(slice: &[u8; 8]) -> Self {
let num: u64 = slice[0] as u64
| (slice[1] as u64) << 8
| (slice[2] as u64) << 16
| (slice[3] as u64) << 24
| (slice[4] as u64) << 32
| (slice[5] as u64) << 40
| (slice[6] as u64) << 48
| (slice[7] as u64) << 56;
let num: u64 = u64::from_le_bytes(*slice);

Self(num)
}
Expand Down

0 comments on commit 197807f

Please sign in to comment.