@@ -27,14 +27,14 @@ use crate::decorations::{Decoration, GridBorderDecoration, LineNumberDecoration}
2727#[cfg(feature = "git")]
2828use crate::diff::{get_git_diff, LineChanges};
2929use crate::errors::*;
30−use crate::inputfile::{InputFile, InputFileReader};
30+use crate::input::{Input, InputReader};
3131use crate::line_range::RangeCheckResult;
3232use crate::preprocessor::{expand_tabs, replace_nonprintable};
3333use crate::terminal::{as_terminal_escaped, to_ansi_color};
3434use crate::wrap::WrappingMode;
3535
3636pub trait Printer {
37− fn print_header(&mut self, handle: &mut dyn Write, file: &InputFile) -> Result<()>;
37+ fn print_header(&mut self, handle: &mut dyn Write, file: &Input) -> Result<()>;
3838 fn print_footer(&mut self, handle: &mut dyn Write) -> Result<()>;
3939
4040 fn print_snip(&mut self, handle: &mut dyn Write) -> Result<()>;
@@ -57,7 +57,7 @@ impl SimplePrinter {
5757}
5858
5959impl Printer for SimplePrinter {
60− fn print_header(&mut self, _handle: &mut dyn Write, _file: &InputFile) -> Result<()> {
60+ fn print_header(&mut self, _handle: &mut dyn Write, _file: &Input) -> Result<()> {
6161 Ok(())
6262 }
6363
@@ -101,8 +101,8 @@ impl<'a> InteractivePrinter<'a> {
101101 pub fn new(
102102 config: &'a Config,
103103 assets: &'a HighlightingAssets,
104− file: &InputFile,
105− reader: &mut InputFileReader,
104+ file: &Input,
105+ reader: &mut InputReader,
106106 ) -> Self {
107107 let theme = assets.get_theme(&config.theme);
108108
@@ -160,7 +160,7 @@ impl<'a> InteractivePrinter<'a> {
160160 #[cfg(feature = "git")]
161161 {
162162 if config.style_components.changes() {
163− if let InputFile::Ordinary(ofile) = file {
163+ if let Input::Ordinary(ofile) = file {
164164 line_changes = get_git_diff(ofile.provided_path());
165165 }
166166 }
@@ -230,23 +230,23 @@ impl<'a> InteractivePrinter<'a> {
230230}
231231
232232impl<'a> Printer for InteractivePrinter<'a> {
233− fn print_header(&mut self, handle: &mut dyn Write, file: &InputFile) -> Result<()> {
233+ fn print_header(&mut self, handle: &mut dyn Write, file: &Input) -> Result<()> {
234234 if !self.config.style_components.header() {
235235 if Some(ContentType::BINARY) == self.content_type && !self.config.show_nonprintable {
236236 let input = match file {
237− InputFile::Ordinary(ofile) => {
237+ Input::Ordinary(ofile) => {
238238 format!("file '{}'", &ofile.provided_path().to_string_lossy())
239239 }
240− InputFile::StdIn(Some(name)) => format!(
240+ Input::StdIn(Some(name)) => format!(
241241 "STDIN (with name '{}')",
242242 name.to_string_lossy().into_owned()
243243 ),
244− InputFile::StdIn(None) => "STDIN".to_owned(),
245− InputFile::ThemePreviewFile => "".to_owned(),
246− InputFile::FromReader(_, Some(name)) => {
244+ Input::StdIn(None) => "STDIN".to_owned(),
245+ Input::ThemePreviewFile => "".to_owned(),
246+ Input::FromReader(_, Some(name)) => {
247247 format!("file '{}'", name.to_string_lossy())
248248 }
249− InputFile::FromReader(_, None) => "READER".to_owned(),
249+ Input::FromReader(_, None) => "READER".to_owned(),
250250 };
251251
252252 writeln!(
@@ -281,19 +281,17 @@ impl<'a> Printer for InteractivePrinter<'a> {
281281 }
282282
283283 let (prefix, name) = match file {
284− InputFile::Ordinary(ofile) => (
284+ Input::Ordinary(ofile) => (
285285 "File: ",
286286 Cow::from(ofile.provided_path().to_string_lossy().to_owned()),
287287 ),
288− InputFile::StdIn(Some(name)) => {
288+ Input::StdIn(Some(name)) => ("File: ", Cow::from(name.to_string_lossy().to_owned())),
289+ Input::StdIn(None) => ("File: ", Cow::from("STDIN".to_owned())),
290+ Input::ThemePreviewFile => ("", Cow::from("")),
291+ Input::FromReader(_, Some(name)) => {
289292 ("File: ", Cow::from(name.to_string_lossy().to_owned()))
290293 }
291− InputFile::StdIn(None) => ("File: ", Cow::from("STDIN".to_owned())),
292− InputFile::ThemePreviewFile => ("", Cow::from("")),
293− InputFile::FromReader(_, Some(name)) => {
294− ("File: ", Cow::from(name.to_string_lossy().to_owned()))
295− }
296− InputFile::FromReader(_, None) => ("File: ", Cow::from("READER".to_owned())),
294+ Input::FromReader(_, None) => ("File: ", Cow::from("READER".to_owned())),
297295 };
298296
299297 let mode = match self.content_type {