Strongly typed errors would be helpful:
#[non_exhaustive]
pub struct PatternError {
pub pos: usize,
pub msg: PattternErrorKind,
}
#[non_exhaustive]
enum PattternErrorKind {
// ...
}
This would make it easier for any crates using glob to transform errors into their own messages if desired.