Skip to content

Remove description function in GlobError #94

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -292,10 +292,6 @@ impl GlobError {
}

impl Error for GlobError {
fn description(&self) -> &str {
self.error.description()
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing functions like this is a breaking change, since callers may be using this routine to get a short description of the error. Could you please us #[allow(deprecated)] instead?


#[allow(unknown_lints, bare_trait_objects)]
fn cause(&self) -> Option<&Error> {
Some(&self.error)
Expand Down Expand Up @@ -594,11 +590,12 @@ impl Pattern {
});
};

let tokens_len = tokens.len();

if is_valid {
// collapse consecutive AnyRecursiveSequence to a
// single one

let tokens_len = tokens.len();

if !(tokens_len > 1 && tokens[tokens_len - 1] == AnyRecursiveSequence) {
is_recursive = true;
tokens.push(AnyRecursiveSequence);
Expand Down Expand Up @@ -967,7 +964,7 @@ fn chars_eq(a: char, b: char, case_sensitive: bool) -> bool {

/// Configuration options to modify the behaviour of `Pattern::matches_with(..)`.
#[allow(missing_copy_implementations)]
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
pub struct MatchOptions {
/// Whether or not patterns should be matched in a case-sensitive manner.
/// This currently only considers upper/lower case relationships between
Expand Down