mirror of
https://github.com/sharkdp/bat.git
synced 2025-02-15 09:28:26 +00:00
Fix clippy::manual_pattern_char_comparison
warnings
This commit is contained in:
parent
2c49d905e4
commit
cbc9c3629d
@ -144,7 +144,7 @@ impl<'a> Printer for SimplePrinter<'a> {
|
|||||||
// Skip squeezed lines.
|
// Skip squeezed lines.
|
||||||
if let Some(squeeze_limit) = self.config.squeeze_lines {
|
if let Some(squeeze_limit) = self.config.squeeze_lines {
|
||||||
if String::from_utf8_lossy(line_buffer)
|
if String::from_utf8_lossy(line_buffer)
|
||||||
.trim_end_matches(|c| c == '\r' || c == '\n')
|
.trim_end_matches(['\r', '\n'])
|
||||||
.is_empty()
|
.is_empty()
|
||||||
{
|
{
|
||||||
self.consecutive_empty_lines += 1;
|
self.consecutive_empty_lines += 1;
|
||||||
@ -644,7 +644,7 @@ impl<'a> Printer for InteractivePrinter<'a> {
|
|||||||
|
|
||||||
// Skip squeezed lines.
|
// Skip squeezed lines.
|
||||||
if let Some(squeeze_limit) = self.config.squeeze_lines {
|
if let Some(squeeze_limit) = self.config.squeeze_lines {
|
||||||
if line.trim_end_matches(|c| c == '\r' || c == '\n').is_empty() {
|
if line.trim_end_matches(['\r', '\n']).is_empty() {
|
||||||
self.consecutive_empty_lines += 1;
|
self.consecutive_empty_lines += 1;
|
||||||
if self.consecutive_empty_lines > squeeze_limit {
|
if self.consecutive_empty_lines > squeeze_limit {
|
||||||
return Ok(());
|
return Ok(());
|
||||||
@ -697,7 +697,7 @@ impl<'a> Printer for InteractivePrinter<'a> {
|
|||||||
// Regular text.
|
// Regular text.
|
||||||
EscapeSequence::Text(text) => {
|
EscapeSequence::Text(text) => {
|
||||||
let text = self.preprocess(text, &mut cursor_total);
|
let text = self.preprocess(text, &mut cursor_total);
|
||||||
let text_trimmed = text.trim_end_matches(|c| c == '\r' || c == '\n');
|
let text_trimmed = text.trim_end_matches(['\r', '\n']);
|
||||||
|
|
||||||
write!(
|
write!(
|
||||||
handle,
|
handle,
|
||||||
@ -751,10 +751,8 @@ impl<'a> Printer for InteractivePrinter<'a> {
|
|||||||
match chunk {
|
match chunk {
|
||||||
// Regular text.
|
// Regular text.
|
||||||
EscapeSequence::Text(text) => {
|
EscapeSequence::Text(text) => {
|
||||||
let text = self.preprocess(
|
let text = self
|
||||||
text.trim_end_matches(|c| c == '\r' || c == '\n'),
|
.preprocess(text.trim_end_matches(['\r', '\n']), &mut cursor_total);
|
||||||
&mut cursor_total,
|
|
||||||
);
|
|
||||||
|
|
||||||
let mut max_width = cursor_max - cursor;
|
let mut max_width = cursor_max - cursor;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user