diff options
Diffstat (limited to 'crates/shirabe/src/util/svn.rs')
| -rw-r--r-- | crates/shirabe/src/util/svn.rs | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/crates/shirabe/src/util/svn.rs b/crates/shirabe/src/util/svn.rs index d07b3ffe..8018efa5 100644 --- a/crates/shirabe/src/util/svn.rs +++ b/crates/shirabe/src/util/svn.rs @@ -6,7 +6,7 @@ use crate::io::IOInterfaceImmutable; use crate::io::io_interface; use crate::util::Platform; use crate::util::ProcessExecutor; -use shirabe_pcre::{CaptureKey, Preg, PregMatchedGroups}; +use shirabe_pcre::{CaptureKey, Preg}; use shirabe_php_shim::{ LogicException, PhpMixed, RuntimeException, implode, parse_url, php_regex, stripos, strpos, trim, @@ -405,20 +405,14 @@ impl Svn { &["svn".to_string(), "--version".to_string()], &mut output, None, - ) { - let mut matches = PregMatchedGroups::new(); - if Preg::is_match3( - php_regex!(r"{(\d+(?:\.\d+)+)}"), - &output, - Some(&mut matches), - ) { - *cached = Some( - matches - .get(&CaptureKey::ByIndex(1)) - .cloned() - .unwrap_or_default(), - ); - } + ) && let Some(matches) = Preg::is_match3(php_regex!(r"{(\d+(?:\.\d+)+)}"), &output) + { + *cached = Some( + matches + .get(&CaptureKey::ByIndex(1)) + .cloned() + .unwrap_or_default(), + ); } } |
