Skip to content

Commit

Permalink
Use vec for extra args as empty vec works fine there
Browse files Browse the repository at this point in the history
  • Loading branch information
leiserfg committed Mar 27, 2023
1 parent d35b392 commit 4477b04
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions crates/ruff/src/rules/flake8_i18n/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ pub struct Options {
)]
/// This will be appended to the function_names
/// (or to the default values if that field is missing)
pub extend_function_names: Option<Vec<String>>,
pub extend_function_names: Vec<String>,
}

#[derive(Debug, CacheKey)]
Expand Down Expand Up @@ -70,7 +70,7 @@ impl From<Options> for Settings {
None => default_func_names(),
}
};
res.extend(options.extend_function_names.unwrap_or(vec![]).into_iter());
res.extend(options.extend_function_names);
res
},
}
Expand All @@ -81,7 +81,7 @@ impl From<Settings> for Options {
fn from(settings: Settings) -> Self {
Self {
function_names: Some(settings.functions_names),
extend_function_names: None,
extend_function_names: vec![],
}
}
}

0 comments on commit 4477b04

Please sign in to comment.