Showing the changes to git-pathspec/src (1 of 2 files). Show all
Unified · Split
| @@ -7,18 +7,14 @@ use crate::{MagicSignature, Pattern, SearchMode}; · 6 unmodified lines | ||
| 7 | 7 | pub enum Error { |
| 8 | 8 | #[error("Empty string is not a valid pathspec")] |
| 9 | 9 | EmptyString, |
| 10 | − | |
| 11 | − #[error("Found \"{}\", which is not a valid keyword", found_keyword)] | |
| 10 | + #[error("Found {:?}, which is not a valid keyword", found_keyword)] | |
| 12 | 11 | InvalidKeyword { found_keyword: BString }, |
| 13 | − | |
| 14 | − #[error("Missing ')' at the end of pathspec magic in '{}'", pathspec)] | |
| 12 | + #[error("Missing ')' at the end of pathspec magic in {:?}", pathspec)] | |
| 15 | 13 | MissingClosingParenthesis { pathspec: BString }, |
| 16 | − | |
| 17 | − #[error("Attribute has non-ascii characters or starts with '-': {}", attribute)] | |
| 14 | + #[error("Attribute has non-ascii characters or starts with '-': {:?}", attribute)] | |
| 18 | 15 | InvalidAttribute { attribute: BString }, |
| 19 | − | |
| 20 | − #[error("'literal' and 'globl' keywords can not be used together in the same pathspec")] | |
| 21 | − IncompatibleSearchmodes, | |
| 16 | + #[error("'literal' and 'glob' keywords cannot be used together in the same pathspec")] | |
| 17 | + IncompatibleSearchModes, | |
| 22 | 18 | } |
| 23 | 19 | |
| 24 | 20 | impl Pattern { |
| @@ -94,11 +90,11 @@ fn parse_keywords(input: &[u8]) -> Result<(MagicSignature, SearchMode, Vec<(BStr · 69 unmodified lines | ||
| 94 | 90 | b"attr" => signature |= MagicSignature::ATTR, |
| 95 | 91 | b"literal" => match searchmode { |
| 96 | 92 | SearchMode::Default => searchmode = SearchMode::Literal, |
| 97 | − _ => return Err(Error::IncompatibleSearchmodes), | |
| 93 | + _ => return Err(Error::IncompatibleSearchModes), | |
| 98 | 94 | }, |
| 99 | 95 | b"glob" => match searchmode { |
| 100 | 96 | SearchMode::Default => searchmode = SearchMode::Glob, |
| 101 | − _ => return Err(Error::IncompatibleSearchmodes), | |
| 97 | + _ => return Err(Error::IncompatibleSearchModes), | |
| 102 | 98 | }, |
| 103 | 99 | s => { |
| 104 | 100 | if let Some(attrs) = s.strip_prefix(b"attr:") { |