diff --git a/Cargo.lock b/Cargo.lock index 5650d5b..0052fda 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -93,15 +93,15 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.141" +version = "0.2.150" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3304a64d199bb964be99741b7a14d26972741915b3649639149b2479bb46f4b5" +checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" [[package]] name = "linux-raw-sys" -version = "0.3.1" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d59d8c75012853d2e872fb56bc8a2e53718e2cafe1a4c823143141c6d90c322f" +checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" [[package]] name = "num-traits" @@ -114,9 +114,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.37.11" +version = "0.37.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85597d61f83914ddeba6a47b3b8ffe7365107221c2e557ed94426489fefb5f77" +checksum = "fea8ca367a3a01fe35e6943c400addf443c0f57670e6ec51196f71a4b8762dd2" dependencies = [ "bitflags", "errno", diff --git a/build.rs b/build.rs index 53d2612..1f36e26 100644 --- a/build.rs +++ b/build.rs @@ -31,7 +31,7 @@ fn main() { "{}.rs", path.file_name().unwrap().to_str().unwrap() )) - .to_owned(); + .clone(); let mut words: Vec = read_lines_of_file(path) .unwrap() .map(|word| { diff --git a/src/solver/mod.rs b/src/solver/mod.rs index 67da7ec..47a61b2 100644 --- a/src/solver/mod.rs +++ b/src/solver/mod.rs @@ -92,7 +92,7 @@ impl std::fmt::Display for HangmanResult { &self .possible_words .iter() - .map(|s| s.to_string()) + .map(|s| (*s).to_string()) .collect::>(), ", ", max_line_length - " words: ".len(), @@ -204,7 +204,7 @@ pub fn solve_hangman_puzzle( read_words(language, pattern.pattern.len()) .iter() .filter(|word| pattern.matches(word)) - .map(|s| *s) + .copied() .collect::>() } else { read_words(language, pattern.pattern.len()) @@ -212,7 +212,7 @@ pub fn solve_hangman_puzzle( .skip_while(|word| !pattern.first_letter_matches(word)) .take_while(|word| pattern.first_letter_matches(word)) .filter(|word| pattern.matches(word)) - .map(|s| *s) + .copied() .collect::>() };