Skip to content

Under which conditions can GlobSetBuilder::build() error? #2927

Answered by BurntSushi
konstin asked this question in Q&A
Discussion options

You must be logged in to vote

This variant:

/// An error associated with parsing or compiling a regex.
Regex(String),

Specifically, from here:

.map_err(|err| Error {
glob: None,
kind: ErrorKind::Regex(err.to_string()),
})

Something to note here is that a Glob itself can't do any matching. Basically, a Glob is just the result of converting a glob pattern to a regex. That can fail because of invalid glob syntax. But the process of converting a Glob to a GlobMatcher (for matching one glob) or many Globs to a GlobSet (for matching zero or more g…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@konstin
Comment options

Answer selected by konstin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants