Skip to content

Commit

Permalink
replaces outdated way of calling max value of u32
Browse files Browse the repository at this point in the history
  • Loading branch information
sts10 committed Jul 5, 2024
1 parent 38b42d4 commit f80e883
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/display_information/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ use crate::edit_distance::find_edit_distance;
/// Calculate the shortest edit distance between any two words on the list.
fn find_shortest_edit_distance(list: &[String]) -> usize {
// This use of max_value is smelly, but not sure I know how to do it better.
let mut shortest_edit_distance = u32::max_value();
let mut shortest_edit_distance = u32::MAX;
// I think I can cheat and only go through half of the list here
for word1 in list[0..(list.len() / 2)].iter() {
for word2 in list {
Expand Down

0 comments on commit f80e883

Please sign in to comment.