reverse

Function reverse 

Source
pub fn reverse<T>(arr: &[T]) -> Vec<T>
where T: Clone,
Expand description

反转数组/Reverse an array

§参数/Arguments

  • arr - 要反转的数组/The array to reverse

§返回值/Returns

反转后的新数组/New array with elements reversed

§示例/Examples

use slice_reducer::reverse;
let arr = [1, 2, 3];
assert_eq!(reverse(&arr), [3, 2, 1]);