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
Copy file name to clipboardExpand all lines: toad-array/src/lib.rs
+40-20Lines changed: 40 additions & 20 deletions
Original file line number
Diff line number
Diff line change
@@ -36,7 +36,8 @@ use toad_len::Len;
36
36
37
37
/// Operations on ordered indexed collections
38
38
pubtraitIndexed<T>
39
-
whereSelf:Len + Deref<Target = [T]>
39
+
where
40
+
Self:Len + Deref<Target = [T]>,
40
41
{
41
42
/// Insert a new element at `ix`, shifting all other elements to the right.
42
43
///
@@ -181,7 +182,8 @@ pub trait Indexed<T>
181
182
/// assert_eq!(v, vec![5]);
182
183
/// ```
183
184
fndrop_while<F>(&mutself,f:F)
184
-
whereF:for<'a>Fn(&'aT) -> bool
185
+
where
186
+
F:for<'a>Fn(&'aT) -> bool,
185
187
{
186
188
matchself.get(0){
187
189
| Some(t)if !f(&t) => return,
@@ -200,7 +202,8 @@ pub trait Indexed<T>
200
202
/// - `Vec` is `Reserve`, and invokes `Vec::with_capacity`
201
203
/// - `tinyvec::ArrayVec` is `Reserve` and invokes `Default::default()` because creating an `ArrayVec` automatically allocates the required space on the stack.
202
204
pubtraitReserve
203
-
whereSelf:Default
205
+
where
206
+
Self:Default,
204
207
{
205
208
/// Create an instance of the collection with a given capacity.
206
209
///
@@ -218,7 +221,8 @@ pub trait Reserve
218
221
///
219
222
/// If self was longer, drops elements up to `len`
0 commit comments