diff --git a/README.md b/README.md index 1fe42b8e3..c9608f845 100644 --- a/README.md +++ b/README.md @@ -388,6 +388,11 @@ use the options `-u`/`--unrestricted` option (or `-HI` to enable hidden and igno > fd -u … ``` +Also remember that by default, `fd` only searches based on the filename and +doesn't compare the pattern to the full path. If you want to search based on the +full path (similar to the `-path` option of `find`) you need to use the `--full-path` +(or `-p`) option. + ### Colorized output `fd` can colorize files by extension, just like `ls`. In order for this to work, the environment diff --git a/src/output.rs b/src/output.rs index 1d53c55f5..facebc77e 100644 --- a/src/output.rs +++ b/src/output.rs @@ -51,7 +51,7 @@ fn print_trailing_slash( config: &Config, style: Option<&Style>, ) -> io::Result<()> { - if entry.file_type().map_or(false, |ft| ft.is_dir()) { + if entry.file_type().is_some_and(|ft| ft.is_dir()) { write!( stdout, "{}", diff --git a/src/walk.rs b/src/walk.rs index a98bdffd0..0991e1c73 100644 --- a/src/walk.rs +++ b/src/walk.rs @@ -477,7 +477,7 @@ impl WorkerState { && path .symlink_metadata() .ok() - .map_or(false, |m| m.file_type().is_symlink()) => + .is_some_and(|m| m.file_type().is_symlink()) => { DirEntry::broken_symlink(path) }