mirror of
https://git.proxmox.com/git/proxmox
synced 2025-08-07 07:38:59 +00:00
api: let ConstRegexPattern deref to Regex
This way we can just use `SOME_REGEX.is_match()` again without having to explicitly call `(SOME_REGEX.regex_obj)()` first. Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
197b1bccb3
commit
8a6e741d6c
@ -19,6 +19,14 @@ impl fmt::Debug for ConstRegexPattern {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl std::ops::Deref for ConstRegexPattern {
|
||||||
|
type Target = regex::Regex;
|
||||||
|
|
||||||
|
fn deref(&self) -> &Self::Target {
|
||||||
|
(self.regex_obj)()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// Macro to generate a ConstRegexPattern
|
/// Macro to generate a ConstRegexPattern
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
|
Loading…
Reference in New Issue
Block a user