@@ -40,11 +40,11 @@ impl Mapper for DirectoryMapper {
4040 let mut owner_matchers = Vec :: new ( ) ;
4141
4242 for file in & self . project . directory_codeowner_files {
43- owner_matchers. push ( OwnerMatcher :: Glob {
44- glob : format ! ( "{}/**/**" , escape_brackets( & file. directory_root( ) . to_string_lossy( ) ) ) ,
45- team_name : file. owner . to_owned ( ) ,
46- source : Source :: Directory ( file. directory_root ( ) . to_string_lossy ( ) . to_string ( ) ) ,
47- } ) ;
43+ owner_matchers. push ( OwnerMatcher :: new_glob (
44+ format ! ( "{}/**/**" , escape_brackets( & file. directory_root( ) . to_string_lossy( ) ) ) ,
45+ file. owner . to_owned ( ) ,
46+ Source :: Directory ( file. directory_root ( ) . to_string_lossy ( ) . to_string ( ) ) ,
47+ ) ) ;
4848 }
4949
5050 owner_matchers
@@ -125,21 +125,21 @@ mod tests {
125125 vecs_match (
126126 & mapper. owner_matchers ( ) ,
127127 & vec ! [
128- OwnerMatcher :: Glob {
129- glob : "app/consumers/**/**" . to_owned( ) ,
130- team_name : "Bar" . to_owned( ) ,
131- source : Source :: Directory ( "app/consumers" . to_string( ) ) ,
132- } ,
133- OwnerMatcher :: Glob {
134- glob : "app/services/**/**" . to_owned( ) ,
135- team_name : "Foo" . to_owned( ) ,
136- source : Source :: Directory ( "app/services" . to_owned( ) ) ,
137- } ,
138- OwnerMatcher :: Glob {
139- glob : "app/services/exciting/**/**" . to_owned( ) ,
140- team_name : "Bar" . to_owned( ) ,
141- source : Source :: Directory ( "app/services/exciting" . to_owned( ) ) ,
142- } ,
128+ OwnerMatcher :: new_glob (
129+ "app/consumers/**/**" . to_owned( ) ,
130+ "Bar" . to_owned( ) ,
131+ Source :: Directory ( "app/consumers" . to_string( ) ) ,
132+ ) ,
133+ OwnerMatcher :: new_glob (
134+ "app/services/**/**" . to_owned( ) ,
135+ "Foo" . to_owned( ) ,
136+ Source :: Directory ( "app/services" . to_owned( ) ) ,
137+ ) ,
138+ OwnerMatcher :: new_glob (
139+ "app/services/exciting/**/**" . to_owned( ) ,
140+ "Bar" . to_owned( ) ,
141+ Source :: Directory ( "app/services/exciting" . to_owned( ) ) ,
142+ ) ,
143143 ] ,
144144 ) ;
145145 Ok ( ( ) )
@@ -152,16 +152,16 @@ mod tests {
152152 vecs_match (
153153 & mapper. owner_matchers ( ) ,
154154 & vec ! [
155- OwnerMatcher :: Glob {
156- glob : "app/\\ [consumers\\ ]/**/**" . to_string( ) ,
157- team_name : "Bar" . to_string( ) ,
158- source : Source :: Directory ( "app/[consumers]" . to_string( ) ) ,
159- } ,
160- OwnerMatcher :: Glob {
161- glob : "app/\\ [consumers\\ ]/deep/nesting/\\ [nestdir\\ ]/**/**" . to_string( ) ,
162- team_name : "Foo" . to_string( ) ,
163- source : Source :: Directory ( "app/[consumers]/deep/nesting/[nestdir]" . to_string( ) ) ,
164- } ,
155+ OwnerMatcher :: new_glob (
156+ "app/\\ [consumers\\ ]/**/**" . to_string( ) ,
157+ "Bar" . to_string( ) ,
158+ Source :: Directory ( "app/[consumers]" . to_string( ) ) ,
159+ ) ,
160+ OwnerMatcher :: new_glob (
161+ "app/\\ [consumers\\ ]/deep/nesting/\\ [nestdir\\ ]/**/**" . to_string( ) ,
162+ "Foo" . to_string( ) ,
163+ Source :: Directory ( "app/[consumers]/deep/nesting/[nestdir]" . to_string( ) ) ,
164+ ) ,
165165 ] ,
166166 ) ;
167167 Ok ( ( ) )
0 commit comments