mirror of
https://github.com/loot/libloot.git
synced 2026-07-27 14:16:01 -07:00
Remove some unnecessary turbofishes
This commit is contained in:
@@ -85,7 +85,7 @@ fn filter_files_on_conditions(
|
||||
files
|
||||
.iter()
|
||||
.filter_map(|file| filter_map_on_condition(file, file.condition(), state))
|
||||
.collect::<Result<Vec<_>, _>>()
|
||||
.collect()
|
||||
}
|
||||
|
||||
fn filter_cleaning_data_on_conditions(
|
||||
@@ -104,7 +104,7 @@ fn filter_cleaning_data_on_conditions(
|
||||
|
||||
filter_map_on_condition(i, Some(condition.as_str()), state)
|
||||
})
|
||||
.collect::<Result<Vec<_>, _>>()
|
||||
.collect()
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
||||
+1
-1
@@ -618,7 +618,7 @@ fn validate_plugin_paths(
|
||||
let resolved_path = resolve_plugin_path(game_type, data_path, path);
|
||||
validate_plugin_path_and_header(game_type, &resolved_path)
|
||||
})
|
||||
.collect::<Result<(), PluginValidationError>>()
|
||||
.collect()
|
||||
}
|
||||
|
||||
fn find_archives(
|
||||
|
||||
+2
-2
@@ -213,7 +213,7 @@ mod tests {
|
||||
fn should_support_a_closure_with_captured_state() {
|
||||
let _lock = TEST_LOCK.lock().unwrap();
|
||||
|
||||
let messages = Arc::new(Mutex::new(Vec::<(LogLevel, String)>::new()));
|
||||
let messages = Arc::new(Mutex::new(Vec::new()));
|
||||
let cloned_messages = messages.clone();
|
||||
let callback = move |level, message: &str| {
|
||||
if let Ok(mut messages) = cloned_messages.lock() {
|
||||
@@ -238,7 +238,7 @@ mod tests {
|
||||
let callback = |_, _: &str| {};
|
||||
set_logging_callback(callback);
|
||||
|
||||
let messages = Arc::new(Mutex::new(Vec::<(LogLevel, String)>::new()));
|
||||
let messages = Arc::new(Mutex::new(Vec::new()));
|
||||
let cloned_messages = messages.clone();
|
||||
let callback = move |level, message: &str| {
|
||||
if let Ok(mut messages) = cloned_messages.lock() {
|
||||
|
||||
@@ -375,14 +375,14 @@ impl TryFromYaml for PluginMetadata {
|
||||
|
||||
let group = get_string_value(hash, "group", YamlObjectType::PluginMetadata)?;
|
||||
|
||||
let load_after = get_vec::<File>(hash, "after")?;
|
||||
let requirements = get_vec::<File>(hash, "req")?;
|
||||
let incompatibilities = get_vec::<File>(hash, "inc")?;
|
||||
let messages = get_vec::<Message>(hash, "msg")?;
|
||||
let tags = get_vec::<Tag>(hash, "tag")?;
|
||||
let dirty_info = get_vec::<PluginCleaningData>(hash, "dirty")?;
|
||||
let clean_info = get_vec::<PluginCleaningData>(hash, "clean")?;
|
||||
let locations = get_vec::<Location>(hash, "url")?;
|
||||
let load_after = get_vec(hash, "after")?;
|
||||
let requirements = get_vec(hash, "req")?;
|
||||
let incompatibilities = get_vec(hash, "inc")?;
|
||||
let messages = get_vec(hash, "msg")?;
|
||||
let tags = get_vec(hash, "tag")?;
|
||||
let dirty_info = get_vec(hash, "dirty")?;
|
||||
let clean_info = get_vec(hash, "clean")?;
|
||||
let locations = get_vec(hash, "url")?;
|
||||
|
||||
Ok(PluginMetadata {
|
||||
name,
|
||||
|
||||
@@ -51,14 +51,14 @@ fn merge_into_hash(
|
||||
value: MarkedYaml,
|
||||
) -> Result<saphyr::AnnotatedHash<MarkedYaml>, YamlMergeKeyError> {
|
||||
match value.data {
|
||||
YamlData::<MarkedYaml>::Array(a) => a.into_iter().try_fold(hash, |acc, e| {
|
||||
YamlData::Array(a) => a.into_iter().try_fold(hash, |acc, e| {
|
||||
if let YamlData::Hash(h) = e.data {
|
||||
Ok(merge_hashes(acc, h))
|
||||
} else {
|
||||
Err(YamlMergeKeyError::new(e))
|
||||
}
|
||||
}),
|
||||
YamlData::<MarkedYaml>::Hash(h) => Ok(merge_hashes(hash, h)),
|
||||
YamlData::Hash(h) => Ok(merge_hashes(hash, h)),
|
||||
_ => Err(YamlMergeKeyError::new(value)),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user