Remove some allocations
This commit is contained in:
@@ -193,6 +193,11 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns all final segments of the argument, longest first.
|
||||
pub fn slice_tails<T>(this: &[T]) -> impl Iterator<Item = &[T]> {
|
||||
(0..this.len()).map(|i| &this[i..])
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
Reference in New Issue
Block a user