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

Make bat::PrettyPrinter::syntaxes() iterate over new bat::Syntax struct (#2222)

We can't keep `syntect::parsing::SyntaxReference` as part of the public
API, because that might prevent us from bumping to syntect 6.0.0 without
also bumping bat to v2.0.0, once we reach v1.0.0.

So introduce a new stripped down struct `Syntax` and return that
instead. Let it be fully owned to make the API simple. It is not going
to be in a hot code path anyway.

I have looked at all code of our 27 dependents but I can't find a single
instance of this method being used, so this change should be safe for
v1.0.0.
This commit is contained in:
Martin Nordholts
2022-09-03 12:33:38 +02:00
committed by GitHub
parent 8b8ff96c32
commit 49875d6ce7
4 changed files with 35 additions and 4 deletions

View File

@@ -48,7 +48,7 @@ pub(crate) mod syntax_mapping;
mod terminal;
pub(crate) mod wrapping;
pub use pretty_printer::{Input, PrettyPrinter};
pub use pretty_printer::{Input, PrettyPrinter, Syntax};
pub use syntax_mapping::{MappingTarget, SyntaxMapping};
pub use wrapping::WrappingMode;