@@ -24,7 +24,7 @@ pub fn root(
24
24
let mut out = path ( & mut path_buf, buf, 0 , file_kind, || None , options, ctx) ?;
25
25
let worktree_root_is_repository = out
26
26
. disk_kind
27
- . map_or ( false , |kind| matches ! ( kind, entry:: Kind :: Repository ) ) ;
27
+ . is_some_and ( |kind| matches ! ( kind, entry:: Kind :: Repository ) ) ;
28
28
29
29
for component in worktree_relative_root. components ( ) {
30
30
if last_length. is_some ( ) {
@@ -200,7 +200,7 @@ pub fn path(
200
200
. pattern_matching_relative_path ( rela_path. as_bstr ( ) , kind. map ( |ft| ft. is_dir ( ) ) , ctx. pathspec_attributes )
201
201
. map ( Into :: into) ;
202
202
203
- if worktree_relative_worktree_dirs. map_or ( false , |worktrees| worktrees. contains ( & * rela_path) ) {
203
+ if worktree_relative_worktree_dirs. is_some_and ( |worktrees| worktrees. contains ( & * rela_path) ) {
204
204
return Ok ( out
205
205
. with_kind ( Some ( entry:: Kind :: Repository ) , None )
206
206
. with_status ( entry:: Status :: Tracked ) ) ;
@@ -267,9 +267,9 @@ pub fn path(
267
267
) ,
268
268
) ;
269
269
}
270
- if kind. map_or ( false , |d| d. is_recursable_dir ( ) )
270
+ if kind. is_some_and ( |d| d. is_recursable_dir ( ) )
271
271
&& ( out. pathspec_match . is_none ( )
272
- || worktree_relative_worktree_dirs. map_or ( false , |worktrees| {
272
+ || worktree_relative_worktree_dirs. is_some_and ( |worktrees| {
273
273
for_deletion. is_some ( )
274
274
&& worktrees
275
275
. iter ( )
@@ -289,7 +289,7 @@ pub fn path(
289
289
debug_assert ! ( maybe_status. is_none( ) ) ;
290
290
let mut status = entry:: Status :: Untracked ;
291
291
292
- if kind. map_or ( false , |ft| ft. is_dir ( ) ) {
292
+ if kind. is_some_and ( |ft| ft. is_dir ( ) ) {
293
293
kind = maybe_upgrade_to_repository ( kind, classify_untracked_bare_repositories) ;
294
294
} else if out. pathspec_match . is_none ( ) {
295
295
status = entry:: Status :: Pruned ;
@@ -313,7 +313,7 @@ pub fn maybe_upgrade_to_repository(
313
313
if is_nested_repo {
314
314
let git_dir_is_our_own = gix_path:: realpath_opts ( path, current_dir, gix_path:: realpath:: MAX_SYMLINKS )
315
315
. ok ( )
316
- . map_or ( false , |realpath_candidate| realpath_candidate == git_dir_realpath) ;
316
+ . is_some_and ( |realpath_candidate| realpath_candidate == git_dir_realpath) ;
317
317
is_nested_repo = !git_dir_is_our_own;
318
318
}
319
319
if is_nested_repo {
@@ -325,7 +325,7 @@ pub fn maybe_upgrade_to_repository(
325
325
if is_nested_nonbare_repo {
326
326
let git_dir_is_our_own = gix_path:: realpath_opts ( path, current_dir, gix_path:: realpath:: MAX_SYMLINKS )
327
327
. ok ( )
328
- . map_or ( false , |realpath_candidate| realpath_candidate == git_dir_realpath) ;
328
+ . is_some_and ( |realpath_candidate| realpath_candidate == git_dir_realpath) ;
329
329
is_nested_nonbare_repo = !git_dir_is_our_own;
330
330
}
331
331
path. pop ( ) ;
@@ -387,7 +387,7 @@ fn resolve_file_type_with_index(
387
387
}
388
388
Some ( entry) => {
389
389
let icase_dir = index. entry_closest_to_directory_icase ( rela_path. as_bstr ( ) , true , accelerate) ;
390
- let directory_matches_exactly = icase_dir. map_or ( false , |dir| {
390
+ let directory_matches_exactly = icase_dir. is_some_and ( |dir| {
391
391
let path = dir. path ( index) ;
392
392
let slash_idx = path. rfind_byte ( b'/' ) . expect ( "dir" ) ;
393
393
path[ ..slash_idx] . as_bstr ( ) == rela_path
@@ -430,7 +430,7 @@ fn resolve_file_type_with_index(
430
430
if all_excluded_from_worktree_non_cone
431
431
|| one_index_signalling_with_cone
432
432
. filter ( |_| kind. is_none ( ) )
433
- . map_or ( false , |idx| index. entries ( ) [ idx] . mode . is_sparse ( ) )
433
+ . is_some_and ( |idx| index. entries ( ) [ idx] . mode . is_sparse ( ) )
434
434
{
435
435
special_property = Some ( entry:: Property :: TrackedExcluded ) ;
436
436
}
0 commit comments