mirror of
				https://github.com/sharkdp/bat.git
				synced 2025-11-04 00:51:56 +00:00 
			
		
		
		
	Simplify ignored filename suffix stripping
This commit is contained in:
		@@ -293,13 +293,8 @@ impl HighlightingAssets {
 | 
			
		||||
                ).or_else(|| {
 | 
			
		||||
                    let file_str = file_path.to_str().unwrap_or_default();
 | 
			
		||||
                    for suffix in IGNORED_SUFFIXES.iter() {
 | 
			
		||||
                        if file_str.ends_with(suffix) {
 | 
			
		||||
                            return self.get_extension_syntax(
 | 
			
		||||
                                OsStr::new(
 | 
			
		||||
                                    file_str
 | 
			
		||||
                                        .strip_suffix(suffix)
 | 
			
		||||
                                        .unwrap_or_default()
 | 
			
		||||
                                ));
 | 
			
		||||
                        if let Some(stripped_filename) = file_str.strip_suffix(suffix) {
 | 
			
		||||
                            return self.get_extension_syntax(OsStr::new(stripped_filename));
 | 
			
		||||
                        }
 | 
			
		||||
                    }
 | 
			
		||||
                    None
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user