From cdeee17c2be5b8b9a333b977b3e2d373b94dfe0a Mon Sep 17 00:00:00 2001 From: bigfoot547 Date: Fri, 31 Jan 2025 02:32:19 -0600 Subject: do clippy stuff and change line endings --- src/launcher/strsub.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/launcher/strsub.rs') diff --git a/src/launcher/strsub.rs b/src/launcher/strsub.rs index 0d2357d..5764405 100644 --- a/src/launcher/strsub.rs +++ b/src/launcher/strsub.rs @@ -69,7 +69,7 @@ pub fn replace_string<'inp, 'rep>(input: &'inp str, sub: &impl SubFunc<'rep>) -> let spec_start = idx + VAR_BEGIN.len(); // the start of the "spec" (area inside {}) // first, check if this is escaped - if let Some((prev_idx, ESCAPE)) = input[..idx].char_indices().rev().next() { + if let Some((prev_idx, ESCAPE)) = input[..idx].char_indices().next_back() { let s = ret.get_or_insert_default(); s.push_str(&input[cursor..prev_idx]); @@ -94,7 +94,7 @@ pub fn replace_string<'inp, 'rep>(input: &'inp str, sub: &impl SubFunc<'rep>) -> }; let after = spec_end + VAR_END.len(); - if let Some(subst) = sub.substitute(name).map_or_else(|| def.map(|d| Cow::Borrowed(d)), |v| Some(v)) { + if let Some(subst) = sub.substitute(name).map_or_else(|| def.map(Cow::Borrowed), Some) { let s = ret.get_or_insert_default(); s.push_str(&input[cursor..idx]); s.push_str(subst.as_ref()); -- cgit v1.2.3-70-g09d2