@@ -25,7 +25,8 @@ enum EntryType {
2525 JavascriptPackage ( AbsolutePath , RelativePath ) ,
2626 CodeownerFile ( AbsolutePath , RelativePath ) ,
2727 TeamFile ( AbsolutePath , RelativePath ) ,
28- PossiblyOwnedFile ( AbsolutePath , RelativePath ) ,
28+ OwnedFile ( AbsolutePath , RelativePath ) ,
29+ NullEntry ( ) ,
2930}
3031
3132#[ derive( Debug ) ]
@@ -142,7 +143,12 @@ impl<'a> ProjectBuilder<'a> {
142143 _ if matches_globs ( & relative_path, & self . config . team_file_glob ) => {
143144 Ok ( EntryType :: TeamFile ( absolute_path. to_owned ( ) , relative_path. to_owned ( ) ) )
144145 }
145- _ => Ok ( EntryType :: PossiblyOwnedFile ( absolute_path. to_owned ( ) , relative_path. to_owned ( ) ) ) ,
146+ _ if matches_globs ( & relative_path, & self . config . owned_globs )
147+ && !matches_globs ( & relative_path, & self . config . unowned_globs ) =>
148+ {
149+ Ok ( EntryType :: OwnedFile ( absolute_path. to_owned ( ) , relative_path. to_owned ( ) ) )
150+ }
151+ _ => Ok ( EntryType :: NullEntry ( ) ) ,
146152 }
147153 }
148154 }
@@ -164,11 +170,8 @@ impl<'a> ProjectBuilder<'a> {
164170 let mut owned_files_vec = Vec :: new ( ) ;
165171 for entry_type in entry_types {
166172 match entry_type {
167- EntryType :: PossiblyOwnedFile ( absolute_path, relative_path) => {
168- if matches_globs ( & relative_path, & self . config . owned_globs ) && !matches_globs ( & relative_path, & self . config . unowned_globs )
169- {
170- owned_files_vec. push ( absolute_path) ;
171- }
173+ EntryType :: OwnedFile ( absolute_path, _relative_path) => {
174+ owned_files_vec. push ( absolute_path) ;
172175 }
173176 EntryType :: Directory ( absolute_path, relative_path) => {
174177 if relative_path. parent ( ) == Some ( Path :: new ( & self . config . vendored_gems_path ) ) {
@@ -217,6 +220,7 @@ impl<'a> ProjectBuilder<'a> {
217220 avoid_ownership : deserializer. github . do_not_add_to_codeowners_file ,
218221 } ) ;
219222 }
223+ EntryType :: NullEntry ( ) => { }
220224 }
221225 }
222226 let owned_files = owned_files ( owned_files_vec) ;
@@ -240,12 +244,8 @@ impl<'a> ProjectBuilder<'a> {
240244 || ( Vec :: new ( ) , Vec :: new ( ) , Vec :: new ( ) , Vec :: new ( ) , Vec :: new ( ) ) ,
241245 |( mut owned_paths, mut pkgs, mut gems, mut codeowners, mut team_files) , entry_type| {
242246 match entry_type {
243- EntryType :: PossiblyOwnedFile ( absolute_path, relative_path) => {
244- if matches_globs ( & relative_path, & self . config . owned_globs )
245- && !matches_globs ( & relative_path, & self . config . unowned_globs )
246- {
247- owned_paths. push ( absolute_path) ;
248- }
247+ EntryType :: OwnedFile ( absolute_path, _relative_path) => {
248+ owned_paths. push ( absolute_path) ;
249249 }
250250 EntryType :: Directory ( absolute_path, relative_path) => {
251251 if relative_path. parent ( ) == Some ( Path :: new ( & self . config . vendored_gems_path ) ) {
@@ -294,6 +294,7 @@ impl<'a> ProjectBuilder<'a> {
294294 avoid_ownership : deserializer. github . do_not_add_to_codeowners_file ,
295295 } ) ;
296296 }
297+ EntryType :: NullEntry ( ) => { }
297298 }
298299 ( owned_paths, pkgs, gems, codeowners, team_files)
299300 } ,
0 commit comments