Skip to content

Commit 47055b6

Browse files
committed
Fix new clippy errors
Introduced in Rust v1.95.0.
1 parent 00d78b6 commit 47055b6

4 files changed

Lines changed: 14 additions & 17 deletions

File tree

src/game_settings.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -684,8 +684,7 @@ fn find_nam_plugins(plugins_path: &Path) -> Result<Vec<String>, Error> {
684684
fn is_file_type_supported(dir_entry: &DirEntry, game_id: GameId) -> bool {
685685
dir_entry
686686
.file_type()
687-
.map(|f| keep_file_type(f, game_id))
688-
.unwrap_or(false)
687+
.is_ok_and(|f| keep_file_type(f, game_id))
689688
}
690689

691690
#[cfg(unix)]

src/ini.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -92,34 +92,34 @@ fn read_test_files(ini_path: &Path) -> Result<TestFiles, Error> {
9292

9393
test_files[0] = ini
9494
.get_from(Some("General"), "sTestFile1")
95-
.map(ToString::to_string);
95+
.map(str::to_owned);
9696
test_files[1] = ini
9797
.get_from(Some("General"), "sTestFile2")
98-
.map(ToString::to_string);
98+
.map(str::to_owned);
9999
test_files[2] = ini
100100
.get_from(Some("General"), "sTestFile3")
101-
.map(ToString::to_string);
101+
.map(str::to_owned);
102102
test_files[3] = ini
103103
.get_from(Some("General"), "sTestFile4")
104-
.map(ToString::to_string);
104+
.map(str::to_owned);
105105
test_files[4] = ini
106106
.get_from(Some("General"), "sTestFile5")
107-
.map(ToString::to_string);
107+
.map(str::to_owned);
108108
test_files[5] = ini
109109
.get_from(Some("General"), "sTestFile6")
110-
.map(ToString::to_string);
110+
.map(str::to_owned);
111111
test_files[6] = ini
112112
.get_from(Some("General"), "sTestFile7")
113-
.map(ToString::to_string);
113+
.map(str::to_owned);
114114
test_files[7] = ini
115115
.get_from(Some("General"), "sTestFile8")
116-
.map(ToString::to_string);
116+
.map(str::to_owned);
117117
test_files[8] = ini
118118
.get_from(Some("General"), "sTestFile9")
119-
.map(ToString::to_string);
119+
.map(str::to_owned);
120120
test_files[9] = ini
121121
.get_from(Some("General"), "sTestFile10")
122-
.map(ToString::to_string);
122+
.map(str::to_owned);
123123

124124
Ok(test_files)
125125
}
@@ -250,7 +250,7 @@ fn read_steam_language_config(appmanifest_acf_path: &Path) -> Result<Option<Stri
250250
.and_then(|o| o.get("language"))
251251
.and_then(|v| v.first())
252252
.and_then(keyvalues_parser::Value::get_str)
253-
.map(ToString::to_string);
253+
.map(str::to_owned);
254254

255255
Ok(language)
256256
}

src/load_order/asterisk_based.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,8 +307,7 @@ fn starts_with_blueprint_ships(plugin_name: &str) -> bool {
307307

308308
plugin_name
309309
.get(..BLUEPRINT_SHIPS_PREFIX.len())
310-
.filter(|prefix| BLUEPRINT_SHIPS_PREFIX.eq_ignore_ascii_case(prefix))
311-
.is_some()
310+
.is_some_and(|prefix| BLUEPRINT_SHIPS_PREFIX.eq_ignore_ascii_case(prefix))
312311
}
313312

314313
fn plugin_line_mapper(line: &str) -> Option<(&str, bool)> {

src/load_order/mutable.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -411,8 +411,7 @@ fn validate_early_loader_positions(
411411
fn generic_insert_position(plugins: &[Plugin], plugin: &Plugin) -> Option<usize> {
412412
let is_master_of = |p: &Plugin| {
413413
p.masters()
414-
.map(|masters| masters.iter().any(|m| plugin.name_matches(m)))
415-
.unwrap_or(false)
414+
.is_ok_and(|masters| masters.iter().any(|m| plugin.name_matches(m)))
416415
};
417416

418417
if plugin.is_blueprint_master() {

0 commit comments

Comments
 (0)