Skip to content

Commit

Permalink
Refactor imports and rename highlighter function
Browse files Browse the repository at this point in the history
  • Loading branch information
bensadeh committed Oct 6, 2024
1 parent d38638d commit 4611a01
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/config/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::cli::Cli;
use crate::highlighter::config::CliOpts;
use crate::highlighter::groups::CliOpts;
use crate::types::{
Config, Error, FolderInfo, Input, Output, PathAndLineCount, GENERAL_ERROR, MISUSE_SHELL_BUILTIN, OK,
};
Expand Down
2 changes: 1 addition & 1 deletion src/highlighter/config.rs → src/highlighter/groups.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ impl HighlighterGroups {
}
}

pub const fn try_get_highlight_groups(cli: CliOpts) -> Result<HighlighterGroups, ConfigError> {
pub const fn get_highlighter_groups(cli: CliOpts) -> Result<HighlighterGroups, ConfigError> {
match determine_highlighter_type(cli) {
AllHighlightersEnabled => Ok(HighlighterGroups::all_enabled()),
SomeHighlightersEnabled => Ok(HighlighterGroups {
Expand Down
4 changes: 2 additions & 2 deletions src/highlighter/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
pub mod config;
pub mod groups;

use crate::highlighter::config::HighlighterGroups;
use crate::highlighter::groups::HighlighterGroups;
use crate::theme::Theme;
use inlet_manifold::highlighter::HighlightBuilder;
use inlet_manifold::*;
Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ async fn main() -> Result<()> {
let config = config::create_config_or_exit_early(&cli);

let cli_options = config::get_cli_opts_for_highlight_groups(&cli);
let highlighter_groups = highlighter::config::try_get_highlight_groups(cli_options)?;
let highlighter_groups = highlighter::groups::get_highlighter_groups(cli_options)?;

let new_theme = theme::reader::parse_theme(cli.config_path.clone())?;
let highlighter = highlighter::get_highlighter(highlighter_groups, new_theme)?;
Expand Down

0 comments on commit 4611a01

Please sign in to comment.