mirror of
https://github.com/TECHNOFAB11/tmux-copyrat.git
synced 2025-12-13 08:30:07 +01:00
refactor: rename ParseError -> Error
This commit is contained in:
parent
7d1bb69c6f
commit
5d9ea6f7f8
8 changed files with 21 additions and 19 deletions
|
|
@ -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