mirror of
https://github.com/sharkdp/bat
synced 2026-08-07 19:31:42 +00:00
Mark MappingTarget as #[non_exhaustive] for increased semver flexibility
This will allow us to add new enum variants in the future without breaking semver compatibility. See https://doc.rust-lang.org/reference/attributes/type_system.html#the-non_exhaustive-attribute Since we already added an enum variant since v0.18.3, now is a good time to mark it as `#[non_exhaustive]`.
This commit is contained in:
+3
-7
@@ -74,13 +74,9 @@ fn get_syntax_mapping_to_paths<'a>(
|
||||
) -> HashMap<&'a str, Vec<String>> {
|
||||
let mut map = HashMap::new();
|
||||
for mapping in mappings {
|
||||
match mapping {
|
||||
(_, MappingTarget::MapToUnknown) => {}
|
||||
(_, MappingTarget::MapExtensionToUnknown) => {}
|
||||
(matcher, MappingTarget::MapTo(s)) => {
|
||||
let globs = map.entry(*s).or_insert_with(Vec::new);
|
||||
globs.push(matcher.glob().glob().into());
|
||||
}
|
||||
if let (matcher, MappingTarget::MapTo(s)) = mapping {
|
||||
let globs = map.entry(*s).or_insert_with(Vec::new);
|
||||
globs.push(matcher.glob().glob().into());
|
||||
}
|
||||
}
|
||||
map
|
||||
|
||||
Reference in New Issue
Block a user