mirror of
https://github.com/loot/libloot.git
synced 2026-07-27 14:16:01 -07:00
Minor refactor
This commit is contained in:
@@ -362,15 +362,13 @@ fn replace_capturing_groups(regex_string: &str) -> Cow<'_, str> {
|
||||
let mut parts = Vec::new();
|
||||
|
||||
while let Some(before) = iter.next() {
|
||||
parts.push(before);
|
||||
|
||||
let Some(after) = iter.peek() else {
|
||||
parts.push(before);
|
||||
break;
|
||||
};
|
||||
|
||||
if after.starts_with('?') || (before.ends_with("\\(") && !before.ends_with("\\\\(")) {
|
||||
parts.push(before);
|
||||
} else {
|
||||
parts.push(before);
|
||||
if !after.starts_with('?') && (!before.ends_with("\\(") || before.ends_with("\\\\(")) {
|
||||
parts.push("?:");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user