1
0
mirror of https://github.com/sharkdp/bat.git synced 2025-02-21 12:28:30 +00:00

fn mocked_pager: Simplify with format!

This commit is contained in:
Martin Nordholts 2021-01-10 13:26:40 +01:00
parent dd6f57e107
commit c2c2b0211a

View File

@ -54,9 +54,7 @@ fn get_mocked_pagers_dir() -> PathBuf {
/// On Windows: 'most' -> 'most.bat' /// On Windows: 'most' -> 'most.bat'
fn mocked_pager(base: &str) -> String { fn mocked_pager(base: &str) -> String {
if cfg!(windows) { if cfg!(windows) {
let mut str = String::from(base); format!("{}.bat", base)
str.push_str(".bat");
str
} else { } else {
String::from(base) String::from(base)
} }