From e57e9b6dbbc7e26692399547be8cf17c2f891021 Mon Sep 17 00:00:00 2001 From: sharkdp Date: Wed, 3 Jun 2020 10:08:41 +0200 Subject: [PATCH] Use 'or_insert_with' --- src/bin/bat/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bin/bat/main.rs b/src/bin/bat/main.rs index 1210f169..3882edc7 100644 --- a/src/bin/bat/main.rs +++ b/src/bin/bat/main.rs @@ -70,7 +70,7 @@ fn get_syntax_mapping_to_paths( match mapping { (_, MappingTarget::MapToUnknown) => {} (matcher, MappingTarget::MapTo(s)) => { - let globs = map.entry((*s).into()).or_insert(Vec::new()); + let globs = map.entry((*s).into()).or_insert_with(Vec::new); globs.push(matcher.glob().glob().into()); } }