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:
1 parent
3767f15c2a
commit
7a6f442c86
1 file changed
+3
-2
@@ -50,9 +50,10 @@ impl ToTokens for MappingTarget {
|
|||||||
/// Whether a glob pattern should be matched case-sensitively or case-insensitively.
|
/// Whether a glob pattern should be matched case-sensitively or case-insensitively.
|
||||||
///
|
///
|
||||||
/// Mirrors the runtime `Case` type in `src/syntax_mapping.rs`.
|
/// 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 {
|
enum Case {
|
||||||
Sensitive,
|
Sensitive,
|
||||||
|
#[default]
|
||||||
Insensitive,
|
Insensitive,
|
||||||
}
|
}
|
||||||
impl ToTokens for Case {
|
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.
|
/// A single matcher.
|
||||||
///
|
///
|
||||||
/// Codegen converts this into a `Lazy<Option<GlobMatcher>>`.
|
/// Codegen converts this into a `Lazy<Option<GlobMatcher>>`.
|
||||||
|
|||||||
Reference in new issue
Block a user