mirror of
https://github.com/TECHNOFAB11/tmux-copyrat.git
synced 2026-02-02 09:25:11 +01:00
refactor: rename ParseError -> Error
This commit is contained in:
parent
7d1bb69c6f
commit
5d9ea6f7f8
8 changed files with 21 additions and 19 deletions
|
|
@ -1,4 +1,4 @@
|
|||
use crate::{error::ParseError, Result};
|
||||
use crate::{error::Error, Result};
|
||||
|
||||
/// Catalog of available alphabets.
|
||||
///
|
||||
|
|
@ -49,7 +49,7 @@ pub fn parse_alphabet(src: &str) -> Result<Alphabet> {
|
|||
let letters = letters.replace(&['n', 'N', 'y', 'Y'][..], "");
|
||||
Ok(Alphabet(letters))
|
||||
}
|
||||
None => Err(ParseError::UnknownAlphabet),
|
||||
None => Err(Error::UnknownAlphabet),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
//!
|
||||
//! All patterns must have one capture group. The first group is used.
|
||||
|
||||
use crate::{error::ParseError, Result};
|
||||
use crate::{error::Error, Result};
|
||||
|
||||
pub(super) const EXCLUDE_PATTERNS: [(&str, &str); 1] =
|
||||
[("ansi_colors", r"[[:cntrl:]]\[([0-9]{1,2};)?([0-9]{1,2})?m")];
|
||||
|
|
@ -54,6 +54,6 @@ pub struct NamedPattern(pub String, pub String);
|
|||
pub(crate) fn parse_pattern_name(src: &str) -> Result<NamedPattern> {
|
||||
match PATTERNS.iter().find(|&(name, _pattern)| name == &src) {
|
||||
Some((name, pattern)) => Ok(NamedPattern(name.to_string(), pattern.to_string())),
|
||||
None => Err(ParseError::UnknownPatternName),
|
||||
None => Err(Error::UnknownPatternName),
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue