mirror of
https://github.com/sharkdp/bat.git
synced 2025-01-19 12:24:17 +00:00
parent
dd48d29c28
commit
549e5d7355
@ -59,7 +59,10 @@ impl<'a> InputFile<'a> {
|
||||
match self {
|
||||
InputFile::StdIn => Ok(InputFileReader::new(stdin.lock())),
|
||||
InputFile::Ordinary(filename) => {
|
||||
let file = File::open(filename)?;
|
||||
let file = match File::open(filename) {
|
||||
Ok(f) => f,
|
||||
Err(e) => return Err(format!("{}: {}", filename, e).into()),
|
||||
};
|
||||
|
||||
if file.metadata()?.is_dir() {
|
||||
return Err(format!("'{}' is a directory.", filename).into());
|
||||
|
Loading…
x
Reference in New Issue
Block a user