From 9cbbe69b241f7f9c09f97dbf51790f91b83cf738 Mon Sep 17 00:00:00 2001 From: Tony Arcieri Date: Mon, 30 Mar 2026 14:12:38 -0600 Subject: [PATCH] Add `AsMut>` impl for `Array` Matches the corresponding `AsRef` impl --- src/lib.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index afa3a03..19dc332 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -207,7 +207,7 @@ where /// Returns an iterator that allows modifying each value. #[inline] pub fn iter_mut(&mut self) -> IterMut<'_, T> { - self.as_mut().iter_mut() + self.0.as_mut().iter_mut() } /// Returns an array of the same size as `self`, with function `f` applied to each element in @@ -605,6 +605,16 @@ where } } +impl AsMut> for Array +where + U: ArraySize, +{ + #[inline] + fn as_mut(&mut self) -> &mut Self { + self + } +} + impl AsMut<[T]> for Array where U: ArraySize,