Wait a few years and nice things stabilise!
• u64::from_ne_bytes([u8; 8]) is stable in 1.32.0
• TryFrom<&[u8]> for [u8; 8] is stable in 1.34.0
(There are other things I’m touching today that also require a more mild
MSRV bump, but this is the most I *need* at this time.)
Explained in the SAFETY comment. I’m not happy about *doing* this, but
it will make *using* this crate easier, since future-compatibility lints
make noise on bin crate builds, so this was polluting other people’s
code and making life harder for users.
I have traded one evil (a spurious warning) for another (unsafe code).
Turns out its commenting technique was completely broken—the attributes
have to be attached to an item *inside* the macro, not outside. And
judging by https://docs.rs/anymap/0.11.0/anymap/any/trait.CloneAny.html,
it was broken from the start, and I never noticed. Sigh. Now, you get a
warning that it’s not going to work like you want. Good stuff.
Well, that macro wasn’t a great idea anyway. Doing without it ends up a
little longer, and risks inconsistent editing, but is decidedly easier
to read.
This reverts commit 479d756c99.
There’s nothing wrong with this patch, but I had never pulled this
commit to my local repository and had completely forgotten about it, and
today removed the unsafe code in a *different* direction that I like
better (`bytes.try_into().map(|bytes| u64::from_ne_bytes(bytes))`), so
reverting it so I can cleanly rebase is just easier for me!
It was implemented on RawMap, and I’m not sure quite why it wasn’t
implemented on Map. I can’t think of any reason *not* to, though, so we
might as well.
Closes#30. Thanks to Maxwell Koo <mjkoo90@gmail.com> for the fix.
A better pattern is to put benchmarks in the `benches` directory;
that way, `cargo test` won’t pick them up by default,
and so it won’t fail on the stable and beta channels.
Somewhere along the path I didn’t mark some functions as `#[inline]`
which they should probably be.
Small but visible benchmark improvements, but within ε so low
confidence.
This *does* mean that they no longer function as tests, which was
deliberate, but rustc is just too slow with the assertions in there as
well. If I care, I can make variants of it that actually test. For now,
I’m sufficiently happy with it.
This is not necessarily the final form, but I think it’s pretty good.
The only alteration to the public interface is the removal of the
iteration methods from `AnyMap`; they are now attached to `RawAnyMap`.
The diff appears considerably more scary than it is in actual fact due
to some comparatively unnecessary changes like the field name (from
`data` to `raw`). Really, it’s minimal.
There’s some Rust updating here too.
This entails the addition of various methods and iterator types where
appropriate, based on what’s on `HashMap`, though I doubt that people
will actually be able to make all that much use of the iterators. They’d
be of more use with a basis of a trait other than `Any`, such as might
be conveniently achieved by combining this with my MOPA crate.
(Getting a little close to HKT there, innit?)
You know, I wonder sometimes if anyone ever reads these messages after
they are written, myself included. If you have read this, please drop me
a note; I’m curious.
I’ve also gone over all the stability attributes, marking things as
appropriate.