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

Commit a771c62

Browse files
committed
clippy
1 parent b42f11b commit a771c62

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

feature-flags/src/flag_matching.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use sha1::{Digest, Sha1};
2-
2+
use std::fmt::Write;
33
use crate::flag_definitions::{FeatureFlag, FlagGroupType};
44

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

146147
hash_val as f64 / LONG_SCALE as f64

0 commit comments

Comments
 (0)