Further simplify module structure

This commit is contained in:
sharkdp 2020-03-21 21:15:12 +01:00 committed by David Peter
parent bb0a3d586e
commit 2c2861db6a
6 changed files with 13 additions and 10 deletions

View File

@ -1,7 +1,6 @@
use bat::{ use bat::{
assets::HighlightingAssets,
config::{Config, InputFile, StyleComponent, StyleComponents}, config::{Config, InputFile, StyleComponent, StyleComponents},
controller::Controller, Controller, HighlightingAssets,
}; };
use console::Term; use console::Term;
use std::process; use std::process;

View File

@ -17,12 +17,12 @@ use console::Term;
use ansi_term; use ansi_term;
use bat::{ use bat::{
assets::HighlightingAssets,
config::{ config::{
Config, HighlightedLineRanges, InputFile, LineRange, LineRanges, OutputWrap, PagingMode, Config, HighlightedLineRanges, InputFile, LineRange, LineRanges, OutputWrap, PagingMode,
StyleComponent, StyleComponents, SyntaxMapping, StyleComponent, StyleComponents, SyntaxMapping,
}, },
errors::*, errors::*,
HighlightingAssets,
}; };
fn is_truecolor_terminal() -> bool { fn is_truecolor_terminal() -> bool {

View File

@ -4,7 +4,7 @@ use std::path::PathBuf;
use crate::directories::PROJECT_DIRS; use crate::directories::PROJECT_DIRS;
use bat::assets::HighlightingAssets; use bat::HighlightingAssets;
fn theme_set_path() -> PathBuf { fn theme_set_path() -> PathBuf {
PROJECT_DIRS.cache_dir().join("themes.bin") PROJECT_DIRS.cache_dir().join("themes.bin")

View File

@ -24,13 +24,13 @@ use ansi_term::Style;
use crate::{app::App, config::config_file}; use crate::{app::App, config::config_file};
use assets::{assets_from_cache_or_binary, cache_dir, clear_assets, config_dir}; use assets::{assets_from_cache_or_binary, cache_dir, clear_assets, config_dir};
use bat::controller::Controller; use bat::Controller;
use directories::PROJECT_DIRS; use directories::PROJECT_DIRS;
use bat::{ use bat::{
assets::HighlightingAssets,
config::{Config, InputFile, StyleComponent, StyleComponents}, config::{Config, InputFile, StyleComponent, StyleComponents},
errors::*, errors::*,
HighlightingAssets,
}; };
fn run_cache_subcommand(matches: &clap::ArgMatches) -> Result<()> { fn run_cache_subcommand(matches: &clap::ArgMatches) -> Result<()> {

View File

@ -12,9 +12,9 @@ extern crate shell_words;
extern crate syntect; extern crate syntect;
extern crate wild; extern crate wild;
pub mod assets; pub(crate) mod assets;
pub mod config; pub mod config;
pub mod controller; pub(crate) mod controller;
mod decorations; mod decorations;
mod diff; mod diff;
pub mod errors; pub mod errors;
@ -23,8 +23,12 @@ mod less;
pub(crate) mod line_range; pub(crate) mod line_range;
mod output; mod output;
mod preprocessor; mod preprocessor;
mod printer; pub(crate) mod printer;
pub(crate) mod style; pub(crate) mod style;
pub(crate) mod syntax_mapping; pub(crate) mod syntax_mapping;
mod terminal; mod terminal;
pub(crate) mod wrap; pub(crate) mod wrap;
pub use assets::HighlightingAssets;
pub use controller::Controller;
pub use printer::{InteractivePrinter, Printer, SimplePrinter};

View File

@ -1,6 +1,6 @@
use std::collections::HashSet; use std::collections::HashSet;
use bat::assets::HighlightingAssets; use bat::HighlightingAssets;
#[test] #[test]
fn no_duplicate_extensions() { fn no_duplicate_extensions() {