on master help sign in
Fix clippy suggestion: .or_else(|| Some(…)) => .or(Some(…))
cd7be01sharkdp
src/bin/bat/input.rs+1−1
@@ -2,7 +2,7 @@ use bat::input::Input;
2use std::ffi::OsStr;
2use std::ffi::OsStr;
3
3
4pub fn new_file_input<'a>(file: &'a OsStr, name: Option<&'a OsStr>) -> Input<'a> {
4pub fn new_file_input<'a>(file: &'a OsStr, name: Option<&'a OsStr>) -> Input<'a> {
5− named(Input::ordinary_file(file), name.or_else(|| Some(file)))
5+ named(Input::ordinary_file(file), name.or(Some(file)))
6}
6}
7
7
8pub fn new_stdin_input(name: Option<&OsStr>) -> Input {
8pub fn new_stdin_input(name: Option<&OsStr>) -> Input {