Commit a34f11c
committed
vec: Use SpecCloneIntoVec::clone_into to implement Vec::clone_from
In the past, Vec::clone_from was implemented using slice::clone_into.
The code from clone_into was later duplicated into clone_from in
8725e4c, which is the commit that adds custom allocator support to
Vec. Presumably this was done because the slice::clone_into only works
for vecs with the default allocator so it would have the wrong type to
clone into Vec<T, A>.
Now that the clone_into implementation is moved out into a specializable
trait anyway we might as well use that to share the code between the two
methods.1 parent ba80c66 commit a34f11c
1 file changed
+1
-30
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2646 | 2646 | | |
2647 | 2647 | | |
2648 | 2648 | | |
2649 | | - | |
2650 | | - | |
2651 | | - | |
2652 | | - | |
2653 | | - | |
2654 | | - | |
2655 | | - | |
2656 | | - | |
2657 | | - | |
2658 | | - | |
2659 | | - | |
2660 | | - | |
2661 | | - | |
2662 | | - | |
2663 | | - | |
2664 | | - | |
2665 | | - | |
2666 | | - | |
2667 | | - | |
2668 | | - | |
2669 | | - | |
2670 | | - | |
2671 | | - | |
2672 | | - | |
2673 | | - | |
2674 | | - | |
2675 | | - | |
2676 | | - | |
2677 | | - | |
2678 | 2649 | | |
2679 | 2650 | | |
2680 | 2651 | | |
| |||
2695 | 2666 | | |
2696 | 2667 | | |
2697 | 2668 | | |
2698 | | - | |
| 2669 | + | |
2699 | 2670 | | |
2700 | 2671 | | |
2701 | 2672 | | |
| |||
0 commit comments