Commit db63a79
committed
API: Un-deprecate ArrayView::into_slice and deprecate ArrayView::to_slice
Looking closely at this one, it's actually clear why it should be called
into_slice (and why it was called so from the start).
There is already a general `ArrayBase::as_slice`.
1. `ArrayView<'a, _>::into_slice(self) -> Option<&'a [A]>` is an extra
feature on top of the generic `as_slice` because exactly: we preserve
the lifetime parameter from the view to the slice.
2. We relax the input parameter from `self` to `&self` because it makes
only makes the method apply in more places and copy less data
The "into" semantic is exactly that the lifetime parameter is preserved
from the array view into the slice. Clippy is just a robot, it didn't
understand this.1 parent e585262 commit db63a79
3 files changed
+4
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
35 | 34 | | |
36 | 35 | | |
37 | 36 | | |
| |||
43 | 42 | | |
44 | 43 | | |
45 | 44 | | |
| 45 | + | |
46 | 46 | | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
| 47 | + | |
52 | 48 | | |
53 | 49 | | |
54 | 50 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
279 | 279 | | |
280 | 280 | | |
281 | 281 | | |
282 | | - | |
| 282 | + | |
283 | 283 | | |
284 | 284 | | |
285 | 285 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
996 | 996 | | |
997 | 997 | | |
998 | 998 | | |
999 | | - | |
| 999 | + | |
1000 | 1000 | | |
1001 | 1001 | | |
1002 | 1002 | | |
| |||
0 commit comments