fix!(slice): mark NESlice::from_slice_unchecked as unsafe#38
Conversation
|
|
||
| #[must_use] | ||
| pub(crate) const fn from_slice_unchecked(slice: &'a [T]) -> Self { | ||
| pub(crate) const unsafe fn from_slice_unchecked(slice: &'a [T]) -> Self { |
There was a problem hiding this comment.
Given that this is pub(crate), is the unsafe necessary?
There was a problem hiding this comment.
Given that this is
pub(crate)
Ah, that's good, it at least makes the change non-breaking.
is the unsafe necessary?
I mean not necessary, but very much wanted imo. This is a method you might realistically want to make pub in the future (it's a useful _unchecked constructor, a common thing in libraries), so I'd say it's better to mark it unsafe now than forget to do it later^^ Besides, it's only used in one place anyway, so the churn is not too high.
5bc8b0a to
dde30b2
Compare
dde30b2 to
bbdedf3
Compare
|
The Github display is weird but this is indeed merged. Thank you! |
|
Oh, thank god, the thought of the PR getting just silently closed made my heart drop for a second 😅 |
|
It's happened to me before too. I was doing rebases and somehow Github lost the connection to the original commits. |
BREAKING CHANGE: marking a public function as
unsafeis breaking as per https://doc.rust-lang.org/cargo/reference/semver.html#fn-unsafe-safe