glob icon indicating copy to clipboard operation
glob copied to clipboard

Make MatchOptions::new const

Open kangalio opened this issue 4 years ago • 1 comments

Little quality of life change that would allow you to create static glob configurations for use throughout the program, like this

pub const CASE_INSENSITIVE_GLOB: glob::MatchOptions = glob::MatchOptions {
    case_sensitive: false,
    ..glob::MatchOptions::new()
};

glob::glob_with("...", CASE_INSENSITIVE_GLOB)

Of course you can easily work around this by manually specifying all the fields. It would be convenient to be able to fill in default values, though :)

kangalio avatar Dec 22 '20 17:12 kangalio

This sounds good to me! We currently test this crate against 1.23.0, but that release is very old, so I'd be ok with bumping it to support const fn.

KodrAus avatar Jan 08 '21 09:01 KodrAus