mirror of
https://github.com/sharkdp/bat.git
synced 2026-10-30 10:06:12 +00:00
1 parent
dd48d29c28
commit
549e5d7355
1 file changed
+4
-1
+4
-1
@@ -59,7 +59,10 @@ impl<'a> InputFile<'a> {
|
|||||||
match self {
|
match self {
|
||||||
InputFile::StdIn => Ok(InputFileReader::new(stdin.lock())),
|
InputFile::StdIn => Ok(InputFileReader::new(stdin.lock())),
|
||||||
InputFile::Ordinary(filename) => {
|
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() {
|
if file.metadata()?.is_dir() {
|
||||||
return Err(format!("'{}' is a directory.", filename).into());
|
return Err(format!("'{}' is a directory.", filename).into());
|
||||||
|
|||||||
Reference in new issue
Block a user