From 0a679514d41443329c183110a4142e6813bc4307 Mon Sep 17 00:00:00 2001 From: bjorn3 <17426603+bjorn3@users.noreply.github.com> Date: Fri, 7 Mar 2025 16:58:01 +0100 Subject: [PATCH] Avoid unnecessary argument mutation in fluent_bundle --- compiler/rustc_error_messages/src/lib.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/compiler/rustc_error_messages/src/lib.rs b/compiler/rustc_error_messages/src/lib.rs index 56adc583ac4a..aa83ddf8d1fa 100644 --- a/compiler/rustc_error_messages/src/lib.rs +++ b/compiler/rustc_error_messages/src/lib.rs @@ -107,8 +107,8 @@ impl From> for TranslationBundleError { /// (overriding any conflicting messages). #[instrument(level = "trace")] pub fn fluent_bundle( - mut user_provided_sysroot: PathBuf, - mut sysroot_candidates: Vec, + user_provided_sysroot: PathBuf, + sysroot_candidates: Vec, requested_locale: Option, 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");