Skip to content
This repository has been archived by the owner on Jun 21, 2024. It is now read-only.

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
neilkakkar committed May 30, 2024
1 parent b42f11b commit a771c62
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions feature-flags/src/flag_matching.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use sha1::{Digest, Sha1};

use std::fmt::Write;
use crate::flag_definitions::{FeatureFlag, FlagGroupType};

#[derive(Debug, PartialEq, Eq)]
Expand Down Expand Up @@ -138,9 +138,10 @@ impl FeatureFlagMatcher {
// not sure if this is correct, padding each byte as 2 characters
let hex_str: String = result
.iter()
.map(|byte| format!("{:02x}", byte))
.collect::<String>()[..15]
.to_string();
.fold(String::new(), |mut acc, byte| {
let _ = write!(acc, "{:02x}", byte);
acc
})[..15].to_string();
let hash_val = u64::from_str_radix(&hex_str, 16).unwrap();

hash_val as f64 / LONG_SCALE as f64
Expand Down

0 comments on commit a771c62

Please sign in to comment.