Skip to content

Commit

Permalink
style: rename local variable
Browse files Browse the repository at this point in the history
  • Loading branch information
vil02 authored Oct 26, 2024
1 parent 7ad2b65 commit b589d2a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/string/anagram.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ fn clean_string(s: &str) -> Result<String, AnagramError> {
///
/// # Returns
///
/// * A `HashMap` where the keys are characters and values are their frequencies.
/// * A `HashMap` where the keys are characters and values are their count.
fn char_count(s: &str) -> HashMap<char, usize> {
let mut freq = HashMap::new();
let mut res = HashMap::new();
for c in s.chars() {
*freq.entry(c).or_insert(0) += 1;
*res.entry(c).or_insert(0) += 1;
}
freq
res
}

#[cfg(test)]
Expand Down

0 comments on commit b589d2a

Please sign in to comment.