Run cargo fmt --all
This commit is contained in:
+8
-4
@@ -102,16 +102,20 @@ pub fn u64_to_i64(u: u64) -> i64 {
|
||||
}
|
||||
|
||||
/// Splits at the `n`th occurrence of `pattern` counting from the end of the string.
|
||||
///
|
||||
///
|
||||
/// Arguments:
|
||||
/// * `s` - The string to split.
|
||||
/// * `pattern` - The pattern to split at.
|
||||
/// * `n` - The occurrence to split at (counting from the end).
|
||||
///
|
||||
///
|
||||
/// Returns:
|
||||
/// [`Option<(&str, &str)>`] - The splitted parts of the string, or [`None`] if no occurrences of
|
||||
/// `pattern` were found in `s`.
|
||||
pub fn split_at_nth_from_end<'a, 'b>(s: &'a str, pattern: &'b str, n: usize) -> Option<(&'a str, &'a str)> {
|
||||
pub fn split_at_nth_from_end<'a, 'b>(
|
||||
s: &'a str,
|
||||
pattern: &'b str,
|
||||
n: usize,
|
||||
) -> Option<(&'a str, &'a str)> {
|
||||
let mut end = s.len();
|
||||
let mut count = 0;
|
||||
|
||||
@@ -128,4 +132,4 @@ pub fn split_at_nth_from_end<'a, 'b>(s: &'a str, pattern: &'b str, n: usize) ->
|
||||
}
|
||||
|
||||
None
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user