Skip to content

Comments

feat: DirEntry::has_file_extension() and has_file_name()#208

Open
reneleonhardt wants to merge 1 commit intoBurntSushi:masterfrom
reneleonhardt:feat/dir_entry-has_file_extension
Open

feat: DirEntry::has_file_extension() and has_file_name()#208
reneleonhardt wants to merge 1 commit intoBurntSushi:masterfrom
reneleonhardt:feat/dir_entry-has_file_extension

Conversation

@reneleonhardt
Copy link

Features

  • Add DirEntry::has_file_extension()
  • Add DirEntry::has_file_name()

Examples

result
    .ok()
    .filter(|entry| {
        entry.file_type().is_file()
            && entry.path().extension().is_some_and(|ext| ext == "rs")
    })

becomes

result
    .ok()
    .filter(|entry| entry.has_file_extension("rs"))

@reneleonhardt reneleonhardt force-pushed the feat/dir_entry-has_file_extension branch from 567d8a5 to 36dfcad Compare July 12, 2025 06:57
@reneleonhardt reneleonhardt force-pushed the feat/dir_entry-has_file_extension branch from 36dfcad to fb0dc28 Compare July 12, 2025 07:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant