rust-filepatterns: export glob_to_re function stable
authorGeorges Racinet <georges.racinet@octobus.net>
Mon, 11 Mar 2024 13:23:18 +0100
branchstable
changeset 51470 406b413e3cf2
parent 51467 68ed56baabf5
child 51471 5633de951d34
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.
rust/hg-core/src/filepatterns.rs
--- a/rust/hg-core/src/filepatterns.rs	Tue Mar 05 15:07:47 2024 +0100
+++ b/rust/hg-core/src/filepatterns.rs	Mon Mar 11 13:23:18 2024 +0100
@@ -73,7 +73,7 @@
 }
 
 /// Transforms a glob pattern into a regex
-fn glob_to_re(pat: &[u8]) -> Vec<u8> {
+pub fn glob_to_re(pat: &[u8]) -> Vec<u8> {
     let mut input = pat;
     let mut res: Vec<u8> = vec![];
     let mut group_depth = 0;