This commit is contained in:
Anton-4 2022-03-09 09:26:32 +01:00
parent a4d59ae0e7
commit cda90d987c
No known key found for this signature in database
GPG key ID: C954D6E0F9C0ABFD
8 changed files with 25 additions and 45 deletions

View file

@ -33,7 +33,7 @@ pub fn index_of<T: ::std::fmt::Debug + std::cmp::Eq>(elt: T, slice: &[T]) -> Uti
Ok(index)
}
// replace slice method that return Option with one that return Result and proper Error
// replaces slice method that return Option with one that return Result and proper Error
pub fn slice_get<T>(index: usize, slice: &[T]) -> UtilResult<&<usize as SliceIndex<[T]>>::Output> {
let elt_ref = slice.get(index).context(OutOfBounds {
index,