diff --git a/src/assets.rs b/src/assets.rs index 355c8d73..cc6f0d98 100644 --- a/src/assets.rs +++ b/src/assets.rs @@ -9,7 +9,7 @@ use syntect::highlighting::{Theme, ThemeSet}; use syntect::parsing::{SyntaxReference, SyntaxSet, SyntaxSetBuilder}; use crate::assets_metadata::AssetsMetadata; -use crate::errors::*; +use crate::error::*; use crate::input::{InputReader, OpenedInput, OpenedInputKind}; use crate::syntax_mapping::{MappingTarget, SyntaxMapping}; diff --git a/src/assets_metadata.rs b/src/assets_metadata.rs index d4aaaea1..da0ed88f 100644 --- a/src/assets_metadata.rs +++ b/src/assets_metadata.rs @@ -5,7 +5,7 @@ use std::time::SystemTime; use semver::Version; use serde::{Deserialize, Serialize}; -use crate::errors::*; +use crate::error::*; #[derive(Debug, PartialEq, Default, Serialize, Deserialize)] pub struct AssetsMetadata { diff --git a/src/bin/bat/app.rs b/src/bin/bat/app.rs index 7b4bb38d..b47553f3 100644 --- a/src/bin/bat/app.rs +++ b/src/bin/bat/app.rs @@ -16,7 +16,7 @@ use console::Term; use bat::{ assets::HighlightingAssets, config::{Config, PagingMode}, - errors::*, + error::*, input::Input, line_range::{HighlightedLineRanges, LineRange, LineRanges}, style::{StyleComponent, StyleComponents}, diff --git a/src/bin/bat/assets.rs b/src/bin/bat/assets.rs index 1c937433..c0abfb90 100644 --- a/src/bin/bat/assets.rs +++ b/src/bin/bat/assets.rs @@ -7,7 +7,7 @@ use crate::directories::PROJECT_DIRS; use bat::assets::HighlightingAssets; use bat::assets_metadata::AssetsMetadata; -use bat::errors::*; +use bat::error::*; pub fn config_dir() -> Cow<'static, str> { PROJECT_DIRS.config_dir().to_string_lossy() diff --git a/src/bin/bat/config.rs b/src/bin/bat/config.rs index 889ec5d4..38bac82f 100644 --- a/src/bin/bat/config.rs +++ b/src/bin/bat/config.rs @@ -14,7 +14,7 @@ pub fn config_file() -> PathBuf { .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(); if config_file.exists() { println!( diff --git a/src/bin/bat/main.rs b/src/bin/bat/main.rs index 03dee71e..818286d6 100644 --- a/src/bin/bat/main.rs +++ b/src/bin/bat/main.rs @@ -29,7 +29,7 @@ use bat::{ assets::HighlightingAssets, config::Config, controller::Controller, - errors::*, + error::*, input::Input, style::{StyleComponent, StyleComponents}, }; diff --git a/src/controller.rs b/src/controller.rs index 1ce8f965..b173f307 100644 --- a/src/controller.rs +++ b/src/controller.rs @@ -4,7 +4,7 @@ use crate::assets::HighlightingAssets; use crate::config::Config; #[cfg(feature = "paging")] use crate::config::PagingMode; -use crate::errors::*; +use crate::error::*; use crate::input::{Input, InputKind, InputReader, OpenedInput}; use crate::line_range::{LineRanges, RangeCheckResult}; use crate::output::OutputType; diff --git a/src/errors.rs b/src/error.rs similarity index 100% rename from src/errors.rs rename to src/error.rs diff --git a/src/input.rs b/src/input.rs index 95b4eff3..f155c614 100644 --- a/src/input.rs +++ b/src/input.rs @@ -4,7 +4,7 @@ use std::io::{self, BufRead, BufReader, Read}; use content_inspector::{self, ContentType}; -use crate::errors::*; +use crate::error::*; const THEME_PREVIEW_FILE: &[u8] = include_bytes!("../assets/theme_preview.rs"); diff --git a/src/lib.rs b/src/lib.rs index e6cfd4c8..b57247a5 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -15,7 +15,7 @@ //! .input_from_bytes(b"Hello world!\n") //! .language("html") //! .print() -//! .expect("no errors"); +//! .unwrap(); //! ``` pub mod assets; @@ -24,7 +24,7 @@ pub mod config; pub mod controller; mod decorations; mod diff; -pub mod errors; +pub mod error; pub mod input; mod less; pub mod line_range; diff --git a/src/line_range.rs b/src/line_range.rs index 0abbb7ac..ba855fcb 100644 --- a/src/line_range.rs +++ b/src/line_range.rs @@ -1,4 +1,4 @@ -use crate::errors::*; +use crate::error::*; #[derive(Debug, Clone)] pub struct LineRange { diff --git a/src/output.rs b/src/output.rs index 0cfed062..8c1b111f 100644 --- a/src/output.rs +++ b/src/output.rs @@ -4,7 +4,7 @@ use std::process::Child; #[cfg(feature = "paging")] use crate::config::PagingMode; -use crate::errors::*; +use crate::error::*; #[cfg(feature = "paging")] use crate::less::retrieve_less_version; diff --git a/src/pretty_printer.rs b/src/pretty_printer.rs index db64292b..27794201 100644 --- a/src/pretty_printer.rs +++ b/src/pretty_printer.rs @@ -7,7 +7,7 @@ use crate::{ assets::HighlightingAssets, config::Config, controller::Controller, - errors::Result, + error::Result, input::Input, line_range::{HighlightedLineRanges, LineRanges}, style::{StyleComponent, StyleComponents}, diff --git a/src/printer.rs b/src/printer.rs index cdd1d8b0..b40e1a69 100644 --- a/src/printer.rs +++ b/src/printer.rs @@ -25,7 +25,7 @@ use crate::decorations::LineChangesDecoration; use crate::decorations::{Decoration, GridBorderDecoration, LineNumberDecoration}; #[cfg(feature = "git")] use crate::diff::{get_git_diff, LineChanges}; -use crate::errors::*; +use crate::error::*; use crate::input::{OpenedInput, OpenedInputKind}; use crate::line_range::RangeCheckResult; use crate::preprocessor::{expand_tabs, replace_nonprintable}; diff --git a/src/style.rs b/src/style.rs index ffa232ab..24fffd6b 100644 --- a/src/style.rs +++ b/src/style.rs @@ -1,7 +1,7 @@ use std::collections::HashSet; use std::str::FromStr; -use crate::errors::*; +use crate::error::*; #[derive(Debug, Eq, PartialEq, Copy, Clone, Hash)] pub enum StyleComponent { diff --git a/src/syntax_mapping.rs b/src/syntax_mapping.rs index 72cb021c..259f8212 100644 --- a/src/syntax_mapping.rs +++ b/src/syntax_mapping.rs @@ -1,6 +1,6 @@ use std::path::Path; -use crate::errors::Result; +use crate::error::Result; use globset::{Candidate, GlobBuilder, GlobMatcher};