Skip to content

Commit 4223d07

Browse files
committed
use Self in impl blocks
1 parent 3049fbd commit 4223d07

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/lib.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -488,8 +488,8 @@ impl fmt::Display for Pattern {
488488
impl FromStr for Pattern {
489489
type Err = PatternError;
490490

491-
fn from_str(s: &str) -> Result<Pattern, PatternError> {
492-
Pattern::new(s)
491+
fn from_str(s: &str) -> Result<Self, PatternError> {
492+
Self::new(s)
493493
}
494494
}
495495

@@ -525,7 +525,7 @@ impl Pattern {
525525
/// This function compiles Unix shell style patterns.
526526
///
527527
/// An invalid glob pattern will yield a `PatternError`.
528-
pub fn new(pattern: &str) -> Result<Pattern, PatternError> {
528+
pub fn new(pattern: &str) -> Result<Self, PatternError> {
529529

530530
let chars = pattern.chars().collect::<Vec<_>>();
531531
let mut tokens = Vec::new();
@@ -632,7 +632,7 @@ impl Pattern {
632632
}
633633
}
634634

635-
Ok(Pattern {
635+
Ok(Self {
636636
tokens,
637637
original: pattern.to_string(),
638638
is_recursive,
@@ -981,8 +981,8 @@ impl MatchOptions {
981981
/// require_literal_leading_dot: false
982982
/// }
983983
/// ```
984-
pub fn new() -> MatchOptions {
985-
MatchOptions {
984+
pub fn new() -> Self {
985+
Self {
986986
case_sensitive: true,
987987
require_literal_separator: false,
988988
require_literal_leading_dot: false,

0 commit comments

Comments
 (0)