1
Fork 0

Avoid unnecessary argument mutation in fluent_bundle

This commit is contained in:
bjorn3 2025-03-07 16:58:01 +01:00
parent b54398e4ea
commit 0a679514d4

View file

@ -107,8 +107,8 @@ impl From<Vec<FluentError>> for TranslationBundleError {
/// (overriding any conflicting messages).
#[instrument(level = "trace")]
pub fn fluent_bundle(
mut user_provided_sysroot: PathBuf,
mut sysroot_candidates: Vec<PathBuf>,
user_provided_sysroot: PathBuf,
sysroot_candidates: Vec<PathBuf>,
requested_locale: Option<LanguageIdentifier>,
additional_ftl_path: Option<&Path>,
with_directionality_markers: bool,
@ -142,8 +142,8 @@ pub fn fluent_bundle(
// If the user requests the default locale then don't try to load anything.
if let Some(requested_locale) = requested_locale {
let mut found_resources = false;
for sysroot in
Some(&mut user_provided_sysroot).into_iter().chain(sysroot_candidates.iter_mut())
for mut sysroot in
Some(user_provided_sysroot).into_iter().chain(sysroot_candidates.into_iter())
{
sysroot.push("share");
sysroot.push("locale");