# HG changeset patch # User Georges Racinet # Date 2024-03-11 12:23:18 # Node ID 406b413e3cf2964685ee639ce9597b35343e8144 # Parent 68ed56baabf55baf89cf7b5709cddd03d6cb6cc7 rust-filepatterns: export glob_to_re function Making this function public should not risk freezing the internal API, and it can be useful for all downstream code that needs to perform glob matching against byte strings, such as RHGitaly where it will be useful to match on branches and tags. diff --git a/rust/hg-core/src/filepatterns.rs b/rust/hg-core/src/filepatterns.rs --- a/rust/hg-core/src/filepatterns.rs +++ b/rust/hg-core/src/filepatterns.rs @@ -73,7 +73,7 @@ pub enum PatternSyntax { } /// Transforms a glob pattern into a regex -fn glob_to_re(pat: &[u8]) -> Vec { +pub fn glob_to_re(pat: &[u8]) -> Vec { let mut input = pat; let mut res: Vec = vec![]; let mut group_depth = 0;