Skip to content

Commit 1e0bb63

Browse files
committed
Avoid unnecessary argument mutation in fluent_bundle
1 parent 7d0ecc2 commit 1e0bb63

File tree

1 file changed

+3
-3
lines changed
  • compiler/rustc_error_messages/src

1 file changed

+3
-3
lines changed

compiler/rustc_error_messages/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ impl From<Vec<FluentError>> for TranslationBundleError {
107107
/// (overriding any conflicting messages).
108108
#[instrument(level = "trace")]
109109
pub fn fluent_bundle(
110-
mut user_provided_sysroot: PathBuf,
111-
mut sysroot_candidates: Vec<PathBuf>,
110+
user_provided_sysroot: PathBuf,
111+
sysroot_candidates: Vec<PathBuf>,
112112
requested_locale: Option<LanguageIdentifier>,
113113
additional_ftl_path: Option<&Path>,
114114
with_directionality_markers: bool,
@@ -142,7 +142,7 @@ pub fn fluent_bundle(
142142
// If the user requests the default locale then don't try to load anything.
143143
if let Some(requested_locale) = requested_locale {
144144
let mut found_resources = false;
145-
for sysroot in Some(&mut user_provided_sysroot).into_iter().chain(sysroot_candidates.iter_mut()) {
145+
for mut sysroot in Some(user_provided_sysroot).into_iter().chain(sysroot_candidates.into_iter()) {
146146
sysroot.push("share");
147147
sysroot.push("locale");
148148
sysroot.push(requested_locale.to_string());

0 commit comments

Comments
 (0)