(&self, by: impl FnMut(&T) -> Result<U, E>)
| 929 | /// Returns `Err(_)` if any call to `by` did. |
| 930 | #[inline] |
| 931 | pub fn try_map<U, E>(&self, by: impl FnMut(&T) -> Result<U, E>) -> Result<SlimSliceBox<U>, E> { |
| 932 | let mapped = self.iter().map(by).collect::<Result<_, _>>()?; |
| 933 | // SAFETY: Doing `.map(..)` can never change the length. |
| 934 | Ok(unsafe { SlimSliceBox::from_boxed_unchecked(mapped) }) |
| 935 | } |
| 936 | } |
| 937 | |
| 938 | impl<T: Debug> Debug for SlimSlice<'_, T> { |