diff options
author | Canop <cano.petrole@gmail.com> | 2021-05-17 20:55:30 +0200 |
---|---|---|
committer | Canop <cano.petrole@gmail.com> | 2021-05-17 20:55:30 +0200 |
commit | 1b66e4d13f5838d1da9c8c27138ee8673d80fef7 (patch) | |
tree | 0e6a0f8f5113dea114af9d0939e1cbe7700d7bfd /src/command | |
parent | 872c9cd2f0f9587a5a6e9bcff9605dd0f4d46832 (diff) |
use lazy-static 2
Diffstat (limited to 'src/command')
-rw-r--r-- | src/command/completion.rs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/command/completion.rs b/src/command/completion.rs index 77f1fe3..0e7090d 100644 --- a/src/command/completion.rs +++ b/src/command/completion.rs @@ -8,7 +8,7 @@ use { path::{self, PathAnchor}, verb::PrefixSearchResult, }, - lazy_regex::regex, + lazy_regex::regex_captures, std::{ io, path::Path, @@ -113,9 +113,7 @@ impl Completions { PrefixSearchResult::Match(_, verb) => verb.get_arg_anchor(), _ => PathAnchor::Unspecified, }; - let c = regex!(r"^(.*?)([^/]*)$").captures(arg).unwrap(); - let parent_part = &c[1]; - let child_part = &c[2]; + let (_, parent_part, child_part) = regex_captures!(r"^(.*?)([^/]*)$", arg).unwrap(); let parent = path::path_from(path, anchor, parent_part); let mut children = Vec::new(); if !parent.exists() { |