1
0
mirror of https://github.com/sharkdp/bat synced 2026-07-29 18:01:43 +00:00

Separate inputs from config

This commit is contained in:
sharkdp
2020-04-21 21:14:44 +02:00
committed by David Peter
parent 5e5cb89da6
commit 1dc328ad49
10 changed files with 61 additions and 41 deletions
+3 -2
View File
@@ -1,6 +1,6 @@
use std::ffi::{OsStr, OsString};
use std::fs::File;
use std::io::{self, BufRead, BufReader};
use std::io::{self, BufRead, BufReader, Read};
use content_inspector::{self, ContentType};
@@ -77,10 +77,10 @@ impl OrdinaryFile {
}
}
#[derive(Debug, Clone, PartialEq)]
pub enum InputFile {
StdIn(Option<OsString>),
Ordinary(OrdinaryFile),
FromReader(Box<dyn Read>, Option<OsString>),
ThemePreviewFile,
}
@@ -101,6 +101,7 @@ impl InputFile {
Ok(InputFileReader::new(BufReader::new(file)))
}
InputFile::ThemePreviewFile => Ok(InputFileReader::new(THEME_PREVIEW_FILE)),
InputFile::FromReader(reader, _) => unimplemented!(), //Ok(InputFileReader::new(BufReader::new(reader))),
}
}
}