Rename error module

This commit is contained in:
sharkdp 2020-04-22 21:45:47 +02:00 committed by David Peter
parent 5f826419d1
commit 702cb198da
16 changed files with 16 additions and 16 deletions

View File

@ -9,7 +9,7 @@ use syntect::highlighting::{Theme, ThemeSet};
use syntect::parsing::{SyntaxReference, SyntaxSet, SyntaxSetBuilder}; use syntect::parsing::{SyntaxReference, SyntaxSet, SyntaxSetBuilder};
use crate::assets_metadata::AssetsMetadata; use crate::assets_metadata::AssetsMetadata;
use crate::errors::*; use crate::error::*;
use crate::input::{InputReader, OpenedInput, OpenedInputKind}; use crate::input::{InputReader, OpenedInput, OpenedInputKind};
use crate::syntax_mapping::{MappingTarget, SyntaxMapping}; use crate::syntax_mapping::{MappingTarget, SyntaxMapping};

View File

@ -5,7 +5,7 @@ use std::time::SystemTime;
use semver::Version; use semver::Version;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use crate::errors::*; use crate::error::*;
#[derive(Debug, PartialEq, Default, Serialize, Deserialize)] #[derive(Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct AssetsMetadata { pub struct AssetsMetadata {

View File

@ -16,7 +16,7 @@ use console::Term;
use bat::{ use bat::{
assets::HighlightingAssets, assets::HighlightingAssets,
config::{Config, PagingMode}, config::{Config, PagingMode},
errors::*, error::*,
input::Input, input::Input,
line_range::{HighlightedLineRanges, LineRange, LineRanges}, line_range::{HighlightedLineRanges, LineRange, LineRanges},
style::{StyleComponent, StyleComponents}, style::{StyleComponent, StyleComponents},

View File

@ -7,7 +7,7 @@ use crate::directories::PROJECT_DIRS;
use bat::assets::HighlightingAssets; use bat::assets::HighlightingAssets;
use bat::assets_metadata::AssetsMetadata; use bat::assets_metadata::AssetsMetadata;
use bat::errors::*; use bat::error::*;
pub fn config_dir() -> Cow<'static, str> { pub fn config_dir() -> Cow<'static, str> {
PROJECT_DIRS.config_dir().to_string_lossy() PROJECT_DIRS.config_dir().to_string_lossy()

View File

@ -14,7 +14,7 @@ pub fn config_file() -> PathBuf {
.unwrap_or_else(|| PROJECT_DIRS.config_dir().join("config")) .unwrap_or_else(|| PROJECT_DIRS.config_dir().join("config"))
} }
pub fn generate_config_file() -> bat::errors::Result<()> { pub fn generate_config_file() -> bat::error::Result<()> {
let config_file = config_file(); let config_file = config_file();
if config_file.exists() { if config_file.exists() {
println!( println!(

View File

@ -29,7 +29,7 @@ use bat::{
assets::HighlightingAssets, assets::HighlightingAssets,
config::Config, config::Config,
controller::Controller, controller::Controller,
errors::*, error::*,
input::Input, input::Input,
style::{StyleComponent, StyleComponents}, style::{StyleComponent, StyleComponents},
}; };

View File

@ -4,7 +4,7 @@ use crate::assets::HighlightingAssets;
use crate::config::Config; use crate::config::Config;
#[cfg(feature = "paging")] #[cfg(feature = "paging")]
use crate::config::PagingMode; use crate::config::PagingMode;
use crate::errors::*; use crate::error::*;
use crate::input::{Input, InputKind, InputReader, OpenedInput}; use crate::input::{Input, InputKind, InputReader, OpenedInput};
use crate::line_range::{LineRanges, RangeCheckResult}; use crate::line_range::{LineRanges, RangeCheckResult};
use crate::output::OutputType; use crate::output::OutputType;

View File

@ -4,7 +4,7 @@ use std::io::{self, BufRead, BufReader, Read};
use content_inspector::{self, ContentType}; use content_inspector::{self, ContentType};
use crate::errors::*; use crate::error::*;
const THEME_PREVIEW_FILE: &[u8] = include_bytes!("../assets/theme_preview.rs"); const THEME_PREVIEW_FILE: &[u8] = include_bytes!("../assets/theme_preview.rs");

View File

@ -15,7 +15,7 @@
//! .input_from_bytes(b"<span style=\"color: #ff00cc\">Hello world!</span>\n") //! .input_from_bytes(b"<span style=\"color: #ff00cc\">Hello world!</span>\n")
//! .language("html") //! .language("html")
//! .print() //! .print()
//! .expect("no errors"); //! .unwrap();
//! ``` //! ```
pub mod assets; pub mod assets;
@ -24,7 +24,7 @@ pub mod config;
pub mod controller; pub mod controller;
mod decorations; mod decorations;
mod diff; mod diff;
pub mod errors; pub mod error;
pub mod input; pub mod input;
mod less; mod less;
pub mod line_range; pub mod line_range;

View File

@ -1,4 +1,4 @@
use crate::errors::*; use crate::error::*;
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct LineRange { pub struct LineRange {

View File

@ -4,7 +4,7 @@ use std::process::Child;
#[cfg(feature = "paging")] #[cfg(feature = "paging")]
use crate::config::PagingMode; use crate::config::PagingMode;
use crate::errors::*; use crate::error::*;
#[cfg(feature = "paging")] #[cfg(feature = "paging")]
use crate::less::retrieve_less_version; use crate::less::retrieve_less_version;

View File

@ -7,7 +7,7 @@ use crate::{
assets::HighlightingAssets, assets::HighlightingAssets,
config::Config, config::Config,
controller::Controller, controller::Controller,
errors::Result, error::Result,
input::Input, input::Input,
line_range::{HighlightedLineRanges, LineRanges}, line_range::{HighlightedLineRanges, LineRanges},
style::{StyleComponent, StyleComponents}, style::{StyleComponent, StyleComponents},

View File

@ -25,7 +25,7 @@ use crate::decorations::LineChangesDecoration;
use crate::decorations::{Decoration, GridBorderDecoration, LineNumberDecoration}; use crate::decorations::{Decoration, GridBorderDecoration, LineNumberDecoration};
#[cfg(feature = "git")] #[cfg(feature = "git")]
use crate::diff::{get_git_diff, LineChanges}; use crate::diff::{get_git_diff, LineChanges};
use crate::errors::*; use crate::error::*;
use crate::input::{OpenedInput, OpenedInputKind}; use crate::input::{OpenedInput, OpenedInputKind};
use crate::line_range::RangeCheckResult; use crate::line_range::RangeCheckResult;
use crate::preprocessor::{expand_tabs, replace_nonprintable}; use crate::preprocessor::{expand_tabs, replace_nonprintable};

View File

@ -1,7 +1,7 @@
use std::collections::HashSet; use std::collections::HashSet;
use std::str::FromStr; use std::str::FromStr;
use crate::errors::*; use crate::error::*;
#[derive(Debug, Eq, PartialEq, Copy, Clone, Hash)] #[derive(Debug, Eq, PartialEq, Copy, Clone, Hash)]
pub enum StyleComponent { pub enum StyleComponent {

View File

@ -1,6 +1,6 @@
use std::path::Path; use std::path::Path;
use crate::errors::Result; use crate::error::Result;
use globset::{Candidate, GlobBuilder, GlobMatcher}; use globset::{Candidate, GlobBuilder, GlobMatcher};