You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You've probably duplicated a lot of code in exercise 2.4.1.F. We can reduce the boilerplate by defining an empty trait:
traitLocalStorageVecIndex{}
First, implement this trait for usize, RangeTo, RangeFrom, and Range.
Next, replace the multiple implementations of Index with a single implementation. In English:
"For each type T, I and constant N of type usize, implement Index for LocalStorageVec<T, N>, where I implements LocalStorageVecIndex and [T] implements Index"
But it seems the trait bound LocalStorageVecIndex on I is unnecessary. Removing it also works, e.g.:
The text says:
But it seems the trait bound
LocalStorageVecIndex
onI
is unnecessary. Removing it also works, e.g.:or
Both compile and run without error.
The text was updated successfully, but these errors were encountered: