mirror of
https://github.com/sharkdp/bat
synced 2024-11-27 22:30:33 +00:00
Hide some methods from HighlightingAssets
This commit is contained in:
parent
62f2d0c100
commit
094c526a0e
2 changed files with 6 additions and 6 deletions
|
@ -142,11 +142,11 @@ impl HighlightingAssets {
|
|||
self.syntax_set.syntaxes()
|
||||
}
|
||||
|
||||
pub fn themes(&self) -> &BTreeMap<String, Theme> {
|
||||
&self.theme_set.themes
|
||||
pub fn themes(&self) -> impl Iterator<Item = &String> {
|
||||
self.theme_set.themes.keys()
|
||||
}
|
||||
|
||||
pub fn get_theme(&self, theme: &str) -> &Theme {
|
||||
pub(crate) fn get_theme(&self, theme: &str) -> &Theme {
|
||||
match self.theme_set.themes.get(theme) {
|
||||
Some(theme) => theme,
|
||||
None => {
|
||||
|
@ -161,6 +161,7 @@ impl HighlightingAssets {
|
|||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
pub fn get_syntax(
|
||||
&self,
|
||||
language: Option<&str>,
|
||||
|
|
|
@ -121,7 +121,6 @@ pub fn list_languages(config: &Config) -> Result<()> {
|
|||
|
||||
pub fn list_themes(cfg: &Config) -> Result<()> {
|
||||
let assets = assets_from_cache_or_binary();
|
||||
let themes = assets.themes();
|
||||
let mut config = cfg.clone();
|
||||
let mut style = HashSet::new();
|
||||
style.insert(OutputComponent::Plain);
|
||||
|
@ -132,7 +131,7 @@ pub fn list_themes(cfg: &Config) -> Result<()> {
|
|||
let mut stdout = stdout.lock();
|
||||
|
||||
if config.colored_output {
|
||||
for (theme, _) in themes.iter() {
|
||||
for theme in assets.themes() {
|
||||
writeln!(
|
||||
stdout,
|
||||
"Theme: {}\n",
|
||||
|
@ -143,7 +142,7 @@ pub fn list_themes(cfg: &Config) -> Result<()> {
|
|||
writeln!(stdout)?;
|
||||
}
|
||||
} else {
|
||||
for (theme, _) in themes.iter() {
|
||||
for theme in assets.themes() {
|
||||
writeln!(stdout, "{}", theme)?;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue