mirror of
https://github.com/sharkdp/bat
synced 2026-07-20 16:33:20 +00:00
improvements from PR review
- prefer to use `Default::default` because it's semantically clearer why we've chosen to use a particular value
This commit is contained in:
@@ -50,9 +50,10 @@ impl ToTokens for MappingTarget {
|
||||
/// Whether a glob pattern should be matched case-sensitively or case-insensitively.
|
||||
///
|
||||
/// Mirrors the runtime `Case` type in `src/syntax_mapping.rs`.
|
||||
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
|
||||
#[derive(Clone, Debug, PartialEq, Eq, Hash, Default)]
|
||||
enum Case {
|
||||
Sensitive,
|
||||
#[default]
|
||||
Insensitive,
|
||||
}
|
||||
impl ToTokens for Case {
|
||||
@@ -65,7 +66,7 @@ impl ToTokens for Case {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
|
||||
#[derive(Clone, Debug, Default, PartialEq, Eq, Hash)]
|
||||
/// A single matcher.
|
||||
///
|
||||
/// Codegen converts this into a `Lazy<Option<GlobMatcher>>`.
|
||||
|
||||
Reference in New Issue
Block a user