1
0
mirror of https://github.com/sharkdp/bat.git synced 2025-09-03 11:52:26 +01:00

Use deref coercion to simplify some argument passing

This commit is contained in:
Marcin Puc
2021-09-10 21:58:46 +02:00
committed by Martin Nordholts
parent 7956485e37
commit 4baa346aae
3 changed files with 3 additions and 3 deletions

View File

@@ -151,7 +151,7 @@ impl<'a> SyntaxMapping<'a> {
}
pub(crate) fn get_syntax_for(&self, path: impl AsRef<Path>) -> Option<MappingTarget<'a>> {
let candidate = Candidate::new(path.as_ref());
let candidate = Candidate::new(&path);
let candidate_filename = path.as_ref().file_name().map(Candidate::new);
for (ref glob, ref syntax) in self.mappings.iter().rev() {
if glob.is_match_candidate(&candidate)