Skip to content

Commit

Permalink
remove unnecessary casts to u64 in the Crc<u64> case
Browse files Browse the repository at this point in the history
  • Loading branch information
Moritz Borcherding committed Oct 5, 2023
1 parent 734bcdd commit 24b4d00
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/crc64/bytewise.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ impl<'a> Digest<'a, Bytewise<u64>> {

impl<'a> Hasher for Digest<'a, Bytewise<u64>> {
fn finish(&self) -> u64 {
self.clone().finalize() as u64
self.clone().finalize()
}

fn write(&mut self, bytes: &[u8]) {
Expand Down
2 changes: 1 addition & 1 deletion src/crc64/default.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ impl<'a> Digest<'a, u64> {

impl<'a> Hasher for Digest<'a, u64> {
fn finish(&self) -> u64 {
self.clone().finalize() as u64
self.clone().finalize()
}

fn write(&mut self, bytes: &[u8]) {
Expand Down
2 changes: 1 addition & 1 deletion src/crc64/nolookup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ impl<'a> Digest<'a, NoTable<u64>> {

impl<'a> Hasher for Digest<'a, NoTable<u64>> {
fn finish(&self) -> u64 {
self.clone().finalize() as u64
self.clone().finalize()
}

fn write(&mut self, bytes: &[u8]) {
Expand Down
2 changes: 1 addition & 1 deletion src/crc64/slice16.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ impl<'a> Digest<'a, Slice16<u64>> {

impl<'a> Hasher for Digest<'a, Slice16<u64>> {
fn finish(&self) -> u64 {
self.clone().finalize() as u64
self.clone().finalize()
}

fn write(&mut self, bytes: &[u8]) {
Expand Down

0 comments on commit 24b4d00

Please sign in to comment.