From ef65682b940d666a7128b0bc68793c39b94e3d34 Mon Sep 17 00:00:00 2001 From: Dave Rolsky Date: Sun, 10 Nov 2024 10:42:26 -0500 Subject: [PATCH] Avoid capturing in regexes when not needed --- ubi/src/arch.rs | 2 +- ubi/src/os.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ubi/src/arch.rs b/ubi/src/arch.rs index ae6aeaa..937c9a2 100644 --- a/ubi/src/arch.rs +++ b/ubi/src/arch.rs @@ -365,7 +365,7 @@ pub(crate) static ALL_ARCHES_RE: Lazy = Lazy::new(|| { x86_64_re(), ] .iter() - .map(|r| format!("({})", r.as_str())) + .map(|r| format!("(?:{})", r.as_str())) .join("|"), ) .unwrap() diff --git a/ubi/src/os.rs b/ubi/src/os.rs index a17a243..a442af7 100644 --- a/ubi/src/os.rs +++ b/ubi/src/os.rs @@ -47,7 +47,7 @@ pub(crate) static ALL_OSES_RE: Lazy = Lazy::new(|| { windows_re(), ] .iter() - .map(|r| format!("({})", r.as_str())) + .map(|r| format!("(?:{})", r.as_str())) .join("|"), ) .unwrap()