@@ -6,8 +6,6 @@ use content_inspector::{self, ContentType};
7use crate::error::*;
7use crate::error::*;
9−const THEME_PREVIEW_FILE: &[u8] = include_bytes!("../assets/theme_preview.rs");
11/// A description of an Input source.
9/// A description of an Input source.
12/// This tells bat how to refer to the input.
10/// This tells bat how to refer to the input.
13#[derive(Clone)]
11#[derive(Clone)]
@@ -62,7 +60,6 @@ impl InputDescription {
62pub(crate) enum InputKind<'a> {
60pub(crate) enum InputKind<'a> {
63 OrdinaryFile(OsString),
61 OrdinaryFile(OsString),
66 CustomReader(Box<dyn Read + 'a>),
63 CustomReader(Box<dyn Read + 'a>),
@@ -73,7 +70,6 @@ impl<'a> InputKind<'a> {
73 InputDescription::new(path.to_string_lossy()).with_kind(Some("File"))
70 InputDescription::new(path.to_string_lossy()).with_kind(Some("File"))
75 InputKind::StdIn => InputDescription::new("STDIN"),
72 InputKind::StdIn => InputDescription::new("STDIN"),
76− InputKind::ThemePreviewFile => InputDescription::new(""),
77 InputKind::CustomReader(_) => InputDescription::new("READER"),
73 InputKind::CustomReader(_) => InputDescription::new("READER"),
@@ -93,19 +89,9 @@ pub struct Input<'a> {
93pub(crate) enum OpenedInputKind {
89pub(crate) enum OpenedInputKind {
94 OrdinaryFile(OsString),
90 OrdinaryFile(OsString),
97 CustomReader,
92 CustomReader,
100−impl OpenedInputKind {
101− pub(crate) fn is_theme_preview_file(&self) -> bool {
103− OpenedInputKind::ThemePreviewFile => true,
109pub(crate) struct OpenedInput<'a> {
95pub(crate) struct OpenedInput<'a> {
110 pub(crate) kind: OpenedInputKind,
96 pub(crate) kind: OpenedInputKind,
111 pub(crate) metadata: InputMetadata,
97 pub(crate) metadata: InputMetadata,
@@ -130,14 +116,6 @@ impl<'a> Input<'a> {
133− pub fn theme_preview_file() -> Self {
135− kind: InputKind::ThemePreviewFile,
136− metadata: InputMetadata::default(),
141 pub fn from_reader(reader: Box<dyn Read + 'a>) -> Self {
119 pub fn from_reader(reader: Box<dyn Read + 'a>) -> Self {
143 kind: InputKind::CustomReader(reader),
121 kind: InputKind::CustomReader(reader),
@@ -196,12 +174,6 @@ impl<'a> Input<'a> {
196 InputReader::new(BufReader::new(file))
174 InputReader::new(BufReader::new(file))
199− InputKind::ThemePreviewFile => Ok(OpenedInput {
200− kind: OpenedInputKind::ThemePreviewFile,
202− metadata: self.metadata,
203− reader: InputReader::new(THEME_PREVIEW_FILE),
205 InputKind::CustomReader(reader) => Ok(OpenedInput {
177 InputKind::CustomReader(reader) => Ok(OpenedInput {
206 description,
178 description,
207 kind: OpenedInputKind::CustomReader,
179 kind: OpenedInputKind::CustomReader,