Skip to content

Commit d78caa3

Browse files
committed
Update partition() signature for de-lifetiming of Pattern
rust-lang/rust#127481
1 parent 331b9e2 commit d78caa3

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/strings/partition.rs

+1-4
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)