Skip to content

Commit c71d9b1

Browse files
committed
Go back to Some instead of transmuting to it.
This adds a few more statements to `next`, but optimizes better in the loops (saving 2 blocks in `forward_loop`, for example)
1 parent 304ce1b commit c71d9b1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: core/src/slice/iter/macros.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ macro_rules! iterator {
173173
}
174174
self.ptr = ptr.add(1);
175175
}
176-
crate::intrinsics::transmute::<NonNull<T>, Option<$elem>>(ptr)
176+
Some({ptr}.$into_ref())
177177
}
178178
}
179179

0 commit comments

Comments
 (0)