Commit graph

15 commits

Author SHA1 Message Date
Chris Morgan 93511917c3 Rename UncheckedAnyExt, fix Extend, tweak things
The *name* UncheckedAnyExt was ending up visible in docs, but it had
become an increasingly unpleasant name. “Downcast” is suitable, though,
being private, it’s not still not perfect. But there’s no point in
making it public, as people generally can’t implement it because of
coherence rules (I tried).

Plus documentation and style changes.

As for Extend, eh, that should ideally be in a different commit, but
it’s here now, and I’m the only one working on this code base in
general, so I permit myself to be slightly lazy from time to time.
Trouble was Downcast should never have had an Any supertrait, as it was
grossly misleading, leading to type_id giving `dyn Any`’s TypeId rather
than the underlying type’s.
2022-02-03 01:07:00 +11:00
Chris Morgan 0a1c85f865 no_std support
I’m quite pleased with how this has turned out.

Given the stability-despite-instability of hashbrown (that the API
surface we’re depending on hasn’t changed since 0.1.1), and the
deliberate altered SemVer guarantees for it, it was very tempting
to leave the hashbrown range open, `version = ">=0.1.1"` or at least
`version = ">=0.1.1, <1"`, but for some reason or other I ended up
deciding not to. I’m still of two minds about it, really.
2022-01-26 00:16:15 +11:00
Chris Morgan 98f2816e62 Change std to core where possible
Only one thing from std left: HashMap.
2022-01-26 00:16:15 +11:00
Chris Morgan 764038fe6e Drop anymap::Any in favour of std::any::Any
Casualties: Any + Sync, CloneAny + Sync. Acceptable losses.
2022-01-26 00:16:15 +11:00
Chris Morgan 521fbfe6bc Refactor to avoid a spurious compatibility warning
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).
2022-01-26 00:16:15 +11:00
Chris Morgan 0656f18289 Unravel the parbroken define! macro
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.
2022-01-26 00:16:15 +11:00
Chris Morgan bf29e608d9 No more bare trait objects: use dyn Trait syntax 2022-01-26 00:16:15 +11:00
Chris Morgan b549457d62 Put in a bunch of #[inline] attributes on fns.
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.
2016-06-11 13:30:33 +10:00
Chris Morgan c52281b376 Use raw pointers for downcasting, not TraitObject
This mirrors a change in mopa.
2016-06-11 10:46:30 +10:00
Chris Morgan 8e413e2065 Remove now-unnecessary #[allow]s. 2016-06-11 09:29:32 +10:00
Chris Morgan f38113a9cf Make Clippy happy. 2016-04-18 15:00:43 +10:00
Chris Morgan 82f41caeb9 0.11.2: just fixing warnings and such. 2016-01-22 12:05:51 +11:00
Chris Morgan 035fb94cd2 Rename 'nightly' feature to 'unstable'. 2015-06-10 09:02:10 +10:00
Chris Morgan ecb4c45060 Implement Debug for Map and RawMap. 2015-06-10 09:02:10 +10:00
Chris Morgan 7606e75aa4 Replace Cargo features with arcane DST magicks.
(It was a toss-up between “arcane” and “eldritch” there; “arcane” won
this time. “Eldritch”, maybe you can be it next time.)
2015-06-10 09:02:10 +10:00