ps-util
Generally helpful utility functions and traits.
Overview
This crate provides three groups of utilities:
Array: a trait implemented for everyAsRef<[T]>type (slices, arrays, vectors, and more) that offers JavaScript-inspired array methods:map,filter,find,reduce,join,flat,some,every, and many more. It also includes binary-search-based*_equal_in_sorted_bymethods for sorted slices, such asfind_equal_in_sorted_byandslice_equal_in_sorted_by, which run inO(log n).subarray,subarray_checked,subarray_unchecked: functions returning a fixed-size array reference&[T; S]into a slice.ToResultandResConv: ergonomic conversions forResultandOptionvalues.
Usage
Add the dependency:
Then:
use ;
let arr = ;
assert_eq!;
assert_eq!;
assert_eq!;
assert_eq!;
License
Licensed under the GNU General Public License, version 3 or later.