Skip to content
Myr

globset: remove `__Nonexhaustive` work-around

Before adoption: this commit came in with the history the project adopted, so no landing records it.

This existed before the `#[non_exhaustive]` attribute was a thing. Since it was not part of the API of the crate, it is not a semver incompatible change.

authored by Andrew Gallant · committed by Andrew Gallant · parent 5f5da48 · Browse files · 1 file+1 added−9 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+1 added−9 removed

  • other:+1 added−9 removed

1 file+1 added−9 removed

modified:crates/globset/src/lib.rs+1 added-9 removed
161 unmodified lines
162}163164/// The kind of error that can occur when parsing a glob pattern.165#[derive(Clone, Debug, Eq, PartialEq)]166#[non_exhaustive]167pub enum ErrorKind {168 /// **DEPRECATED**.169 ///170 /// This error used to occur for consistency with git's glob specification,
21 unmodified lines
192 /// Occurs when an unescaped '\' is found at the end of a glob.193 DanglingEscape,194 /// An error associated with parsing or compiling a regex.195 Regex(String),195 /// Hints that destructuring should not be exhaustive.196 ///197 /// This enum may grow additional variants, so this makes sure clients198 /// don't count on exhaustive matching. (Otherwise, adding a new variant199 /// could break existing code.)200 #[doc(hidden)]201 __Nonexhaustive,196}197198impl std::error::Error for Error {199 fn description(&self) -> &str {
35 unmodified lines
235 "nested alternate groups are not allowed"236 }237 ErrorKind::DanglingEscape => "dangling '\\'",238 ErrorKind::Regex(ref err) => err,245 ErrorKind::__Nonexhaustive => unreachable!(),239 }240 }241}242
20 unmodified lines
263 | ErrorKind::Regex(_) => write!(f, "{}", self.description()),264 ErrorKind::InvalidRange(s, e) => {265 write!(f, "invalid range; '{}' > '{}'", s, e)266 }274 ErrorKind::__Nonexhaustive => unreachable!(),267 }268 }269}270
840 unmodified lines