Skip to content

Commit 5537919

Browse files
authored
Merge pull request #8 from jwodder/pattern-update
Update `partition()` signature for de-lifetiming of `Pattern`
2 parents 331b9e2 + d78caa3 commit 5537919

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/strings/partition.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,7 @@ use std::str::pattern::Pattern;
1717
/// assert_eq!(partition("abc.123-xyz", ['-', '.']), Some(("abc", ".", "123-xyz")));
1818
/// assert_eq!(partition("abc_123_xyz", ['-', '.']), None);
1919
/// ```
20-
pub fn partition<'a, P: Pattern<'a>>(
21-
s: &'a str,
22-
pattern: P,
23-
) -> Option<(&'a str, &'a str, &'a str)> {
20+
pub fn partition<P: Pattern>(s: &str, pattern: P) -> Option<(&str, &str, &str)> {
2421
let (i, sep) = s.match_indices(pattern).next()?;
2522
Some((&s[..i], sep, &s[(i + sep.len())..]))
2623
}

0 commit comments

Comments
 (0)