refactor: publicly expose error::Error

This commit is contained in:
graelo 2022-05-31 08:47:53 +02:00
parent 3bebad0da6
commit d2eb8f0e16
7 changed files with 9 additions and 9 deletions

View file

@ -1,9 +1,8 @@
use clap::{ArgEnum, Parser};
use crate::{
error::Error,
textbuf::{alphabet, regexes},
ui, Result,
ui, Error, Result,
};
/// Main configuration, parsed from command line.
@ -70,7 +69,7 @@ pub struct Config {
/// Type introduced due to parsing limitation,
/// as we cannot directly parse tuples into ui::HintStyle.
#[derive(Debug, Clone, ArgEnum, Parser)]
#[derive(Debug, Clone, ArgEnum)]
pub enum HintStyleArg {
Bold,
Italic,

View file

@ -4,7 +4,7 @@ use std::fmt;
use clap::{ArgEnum, Parser};
use super::basic;
use crate::{error::Error, textbuf::alphabet, tmux, ui, Result};
use crate::{textbuf::alphabet, tmux, ui, Error, Result};
/// Extended configuration for handling Tmux-specific configuration (options
/// and outputs). This is only used by `tmux-copyrat` and parsed from command

View file

@ -4,7 +4,8 @@ pub mod textbuf;
pub mod tmux;
pub mod ui;
pub type Result<T> = std::result::Result<T, error::Error>;
pub use error::Error;
pub type Result<T> = std::result::Result<T, Error>;
/// Run copyrat on an input string `buffer`, configured by `Opt`.
///

View file

@ -1,4 +1,4 @@
use crate::{error::Error, Result};
use crate::{Error, Result};
/// Catalog of available alphabets.
///

View file

@ -2,7 +2,7 @@
//!
//! All patterns must have one capture group. The first group is used.
use crate::{error::Error, Result};
use crate::{Error, Result};
pub(super) const EXCLUDE_PATTERNS: [(&str, &str); 1] =
[("ansi_colors", r"[[:cntrl:]]\[([0-9]{1,2};)?([0-9]{1,2})?m")];

View file

@ -10,7 +10,7 @@ use std::str::FromStr;
use regex::Regex;
use crate::config::extended::CaptureRegion;
use crate::{error::Error, Result};
use crate::{Error, Result};
/// Represents a simplified Tmux Pane, only holding the properties needed in
/// this crate.

View file

@ -1,7 +1,7 @@
use clap::Parser;
use termion::color;
use crate::{error::Error, Result};
use crate::{Error, Result};
pub fn parse_color(src: &str) -> Result<Box<dyn color::Color>> {
match src {