1
0
mirror of https://github.com/sharkdp/bat.git synced 2025-09-02 19:32:25 +01:00

Replace Input::stdin_as_file with bat-application functions

This commit is contained in:
Ethan P
2020-05-27 16:25:13 -07:00
committed by David Peter
parent a3357547ea
commit 9d08c0102e
4 changed files with 27 additions and 15 deletions

View File

@@ -125,17 +125,6 @@ impl<'a> Input<'a> {
}
}
pub fn stdin_as_file(name: Option<impl AsRef<OsStr>>) -> Self {
match name {
None => Input::stdin(),
Some(name) => {
let mut input = Input::stdin().with_name(Some(name.as_ref()));
input.description.kind = Some("File".to_owned());
input
}
}
}
pub fn from_reader(reader: Box<dyn Read + 'a>) -> Self {
let kind = InputKind::CustomReader(reader);
Input {