1
0
mirror of https://github.com/sharkdp/bat.git synced 2025-09-06 13:22:23 +01:00

Inline format! args wherever possible

This commit is contained in:
Lena
2024-02-24 22:36:14 +01:00
committed by Martin Nordholts
parent 487bed2d95
commit 4c85483486
17 changed files with 35 additions and 40 deletions

View File

@@ -221,11 +221,11 @@ impl Attributes {
8 => match parameters.next() {
Some(5) /* 256-color */ => format!("\x1B[{};5;{}m", color, join(";", 1, parameters)),
Some(2) /* 24-bit color */ => format!("\x1B[{};2;{}m", color, join(";", 3, parameters)),
Some(c) => format!("\x1B[{};{}m", color, c),
Some(c) => format!("\x1B[{color};{c}m"),
_ => "".to_owned(),
},
9 => "".to_owned(),
_ => format!("\x1B[{}m", color),
_ => format!("\x1B[{color}m"),
}
}
@@ -435,7 +435,7 @@ impl<'a> EscapeSequenceOffsetsIterator<'a> {
}
Some((_, tc)) => {
panic!("this should not be reached: char {:?}", tc)
panic!("this should not be reached: char {tc:?}")
}
}
}