summaryrefslogtreecommitdiffstats
path: root/src/launcher/strsub.rs
diff options
context:
space:
mode:
authorLibravatar bigfoot547 <[email protected]>2025-01-31 02:32:19 -0600
committerLibravatar bigfoot547 <[email protected]>2025-01-31 02:32:19 -0600
commitcdeee17c2be5b8b9a333b977b3e2d373b94dfe0a (patch)
tree58ec48b5bfa9afe03ebbd9716f1f90841af914e9 /src/launcher/strsub.rs
parentRemove some unused imports but not all of them (diff)
do clippy stuff and change line endings
Diffstat (limited to 'src/launcher/strsub.rs')
-rw-r--r--src/launcher/strsub.rs4
1 files changed, 2 insertions, 2 deletions
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());