Remove unused code

This commit is contained in:
Hanno Braun 2022-11-11 12:20:45 +01:00
parent 27b0b202c7
commit 7b2bb4a352
1 changed files with 0 additions and 19 deletions

View File

@ -13,11 +13,6 @@ pub trait ArrayExt<T, const N: usize> {
fn try_map_ext<F, U, E>(self, f: F) -> Result<[U; N], E> fn try_map_ext<F, U, E>(self, f: F) -> Result<[U; N], E>
where where
F: FnMut(T) -> Result<U, E>; F: FnMut(T) -> Result<U, E>;
/// Stable replacement for `zip`
///
/// <https://doc.rust-lang.org/std/primitive.array.html#method.zip>
fn zip_ext<U>(self, rhs: [U; N]) -> [(T, U); N];
} }
impl<T> ArrayExt<T, 2> for [T; 2] { impl<T> ArrayExt<T, 2> for [T; 2] {
@ -33,13 +28,6 @@ impl<T> ArrayExt<T, 2> for [T; 2] {
let [a, b] = self.map(f); let [a, b] = self.map(f);
Ok([a?, b?]) Ok([a?, b?])
} }
fn zip_ext<U>(self, rhs: [U; 2]) -> [(T, U); 2] {
let [a, b] = self;
let [c, d] = rhs;
[(a, c), (b, d)]
}
} }
impl<T> ArrayExt<T, 4> for [T; 4] { impl<T> ArrayExt<T, 4> for [T; 4] {
@ -55,13 +43,6 @@ impl<T> ArrayExt<T, 4> for [T; 4] {
let [a, b, c, d] = self.map(f); let [a, b, c, d] = self.map(f);
Ok([a?, b?, c?, d?]) Ok([a?, b?, c?, d?])
} }
fn zip_ext<U>(self, rhs: [U; 4]) -> [(T, U); 4] {
let [a, b, c, d] = self;
let [e, f, g, h] = rhs;
[(a, e), (b, f), (c, g), (d, h)]
}
} }
/// Extension trait for arrays /// Extension trait for arrays