diff options
Diffstat (limited to 'crates/shirabe/src/config.rs')
| -rw-r--r-- | crates/shirabe/src/config.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/crates/shirabe/src/config.rs b/crates/shirabe/src/config.rs index 3a320d6f..796e23fc 100644 --- a/crates/shirabe/src/config.rs +++ b/crates/shirabe/src/config.rs @@ -647,18 +647,16 @@ impl Config { // numbers with kb/mb/gb support, without env var support "cache-files-maxsize" => { let raw = self.config.get(key).map(php_to_string).unwrap_or_default(); - let mut matches = PregMatchedGroups::new(); - if !Preg::is_match3( + let Some(matches) = Preg::is_match3( php_regex!(r"/^\s*([0-9.]+)\s*(?:([kmg])(?:i?b)?)?\s*$/i"), &raw, - Some(&mut matches), - ) { + ) else { return Err(RuntimeException::new(format!( "Could not parse the value of '{}': {}", key, raw )) .into()); - } + }; let mut size = matches .get(&CaptureKey::ByIndex(1)) .cloned() |
