Commit 6288970
committed
Auto merge of #50487 - nikic:heap-manually-drop, r=Gankro
Use ManuallyDrop instead of Option in BinaryHeap Hole implementation
The Option is always Some until drop, where it becomes None. Make this more explicit and avoid unwraps by using ManuallyDrop.
This change should be performance-neutral as LLVM already optimizes the unwraps away in the inlined code. However I've seen this pattern copied from here to other crates where it is not optimized away, so I think it would be good to change it.1 file changed
+5
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
157 | 157 | | |
158 | 158 | | |
159 | 159 | | |
160 | | - | |
| 160 | + | |
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
| |||
864 | 864 | | |
865 | 865 | | |
866 | 866 | | |
867 | | - | |
868 | | - | |
| 867 | + | |
869 | 868 | | |
870 | 869 | | |
871 | 870 | | |
| |||
879 | 878 | | |
880 | 879 | | |
881 | 880 | | |
882 | | - | |
| 881 | + | |
883 | 882 | | |
884 | 883 | | |
885 | 884 | | |
| |||
892 | 891 | | |
893 | 892 | | |
894 | 893 | | |
895 | | - | |
| 894 | + | |
896 | 895 | | |
897 | 896 | | |
898 | 897 | | |
| |||
925 | 924 | | |
926 | 925 | | |
927 | 926 | | |
928 | | - | |
| 927 | + | |
929 | 928 | | |
930 | 929 | | |
931 | 930 | | |
| |||
0 commit comments