mirror of
https://github.com/sharkdp/bat.git
synced 2025-01-23 05:58:56 +01:00
Remove deprecated PrettyPrinter methods
This commit is contained in:
parent
b25713938d
commit
060b9981b5
@ -35,6 +35,12 @@
|
||||
|
||||
## `bat` as a library
|
||||
|
||||
- The following `PrettyPrinter` methods have been removed (they were previously deprecated):
|
||||
- `input_stdin_with_name`
|
||||
- `input_from_bytes_with_name`
|
||||
- `input_from_reader_with_name`
|
||||
- `vcs_modification_markers` (if the `git` feature is not enabled)
|
||||
|
||||
## Packaging
|
||||
|
||||
- `bat` is now available on snapstore with package name called `batcat`, see #1401 (@purveshpatel511)
|
||||
|
@ -90,48 +90,17 @@ impl<'a> PrettyPrinter<'a> {
|
||||
self
|
||||
}
|
||||
|
||||
/// Add STDIN as an input (with customized name)
|
||||
#[deprecated]
|
||||
pub fn input_stdin_with_name(&mut self, name: impl AsRef<OsStr>) -> &mut Self {
|
||||
self.inputs
|
||||
.push(Input::from_stdin().name(name).kind("File"));
|
||||
self
|
||||
}
|
||||
|
||||
/// Add a byte string as an input
|
||||
pub fn input_from_bytes(&mut self, content: &'a [u8]) -> &mut Self {
|
||||
self.input_from_reader(content)
|
||||
}
|
||||
|
||||
/// Add a byte string as an input (with customized name)
|
||||
#[deprecated]
|
||||
#[allow(deprecated)]
|
||||
pub fn input_from_bytes_with_name(
|
||||
&mut self,
|
||||
content: &'a [u8],
|
||||
name: impl AsRef<OsStr>,
|
||||
) -> &mut Self {
|
||||
self.input_from_reader_with_name(content, name)
|
||||
}
|
||||
|
||||
/// Add a custom reader as an input
|
||||
pub fn input_from_reader<R: Read + 'a>(&mut self, reader: R) -> &mut Self {
|
||||
self.inputs.push(Input::from_reader(reader));
|
||||
self
|
||||
}
|
||||
|
||||
/// Add a custom reader as an input (with customized name)
|
||||
#[deprecated]
|
||||
pub fn input_from_reader_with_name<R: Read + 'a>(
|
||||
&mut self,
|
||||
reader: R,
|
||||
name: impl AsRef<OsStr>,
|
||||
) -> &mut Self {
|
||||
self.inputs
|
||||
.push(Input::from_reader(reader).name(name).kind("File"));
|
||||
self
|
||||
}
|
||||
|
||||
/// Specify the syntax file which should be used (default: auto-detect)
|
||||
pub fn language(&mut self, language: &'a str) -> &mut Self {
|
||||
self.config.language = Some(language);
|
||||
@ -188,19 +157,9 @@ impl<'a> PrettyPrinter<'a> {
|
||||
|
||||
/// Whether to show modification markers for VCS changes. This has no effect if
|
||||
/// the `git` feature is not activated.
|
||||
#[cfg_attr(
|
||||
not(feature = "git"),
|
||||
deprecated(
|
||||
note = "Using vcs_modification_markers without the 'git' feature has no effect. \
|
||||
The function will be removed (for non-'git' use cases) in the future."
|
||||
)
|
||||
)]
|
||||
#[allow(unused_variables)]
|
||||
#[cfg(feature = "git")]
|
||||
pub fn vcs_modification_markers(&mut self, yes: bool) -> &mut Self {
|
||||
#[cfg(feature = "git")]
|
||||
{
|
||||
self.active_style_components.vcs_modification_markers = yes;
|
||||
}
|
||||
self.active_style_components.vcs_modification_markers = yes;
|
||||
self
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user