mirror of
				https://github.com/sharkdp/bat.git
				synced 2025-11-04 09:01:56 +00:00 
			
		
		
		
	Fix clippy::unnecessary_map_or warnings
				
					
				
			This commit is contained in:
		@@ -267,7 +267,7 @@ impl<'a> InteractivePrinter<'a> {
 | 
			
		||||
        let is_printing_binary = input
 | 
			
		||||
            .reader
 | 
			
		||||
            .content_type
 | 
			
		||||
            .map_or(false, |c| c.is_binary() && !config.show_nonprintable);
 | 
			
		||||
            .is_some_and(|c| c.is_binary() && !config.show_nonprintable);
 | 
			
		||||
 | 
			
		||||
        let needs_to_match_syntax = (!is_printing_binary
 | 
			
		||||
            || matches!(config.binary, BinaryBehavior::AsText))
 | 
			
		||||
@@ -544,7 +544,7 @@ impl<'a> Printer for InteractivePrinter<'a> {
 | 
			
		||||
            })?;
 | 
			
		||||
 | 
			
		||||
        if self.config.style_components.grid() {
 | 
			
		||||
            if self.content_type.map_or(false, |c| c.is_text())
 | 
			
		||||
            if self.content_type.is_some_and(|c| c.is_text())
 | 
			
		||||
                || self.config.show_nonprintable
 | 
			
		||||
                || matches!(self.config.binary, BinaryBehavior::AsText)
 | 
			
		||||
            {
 | 
			
		||||
@@ -559,7 +559,7 @@ impl<'a> Printer for InteractivePrinter<'a> {
 | 
			
		||||
 | 
			
		||||
    fn print_footer(&mut self, handle: &mut OutputHandle, _input: &OpenedInput) -> Result<()> {
 | 
			
		||||
        if self.config.style_components.grid()
 | 
			
		||||
            && (self.content_type.map_or(false, |c| c.is_text())
 | 
			
		||||
            && (self.content_type.is_some_and(|c| c.is_text())
 | 
			
		||||
                || self.config.show_nonprintable
 | 
			
		||||
                || matches!(self.config.binary, BinaryBehavior::AsText))
 | 
			
		||||
        {
 | 
			
		||||
 
 | 
			
		||||
@@ -153,7 +153,7 @@ impl<'a> SyntaxMapping<'a> {
 | 
			
		||||
            if glob.is_match_candidate(&candidate)
 | 
			
		||||
                || candidate_filename
 | 
			
		||||
                    .as_ref()
 | 
			
		||||
                    .map_or(false, |filename| glob.is_match_candidate(filename))
 | 
			
		||||
                    .is_some_and(|filename| glob.is_match_candidate(filename))
 | 
			
		||||
            {
 | 
			
		||||
                return Some(*syntax);
 | 
			
		||||
            }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user