Closed Ogeon closed 1 year ago
I replaced the generic implementations with specific, but more consistent implementations. Also added doc examples for each trait.
bors r+
Build succeeded!
The publicly hosted instance of bors-ng is deprecated and will go away soon.
If you want to self-host your own instance, instructions are here. For more help, visit the forum.
If you want to switch to GitHub's built-in merge queue, visit their help page.
These traits are alternatives to the free functions in
cast
. The idea is to have less "type information" in the naming and only focus on the high level transform. In essence whatFrom
andInto
also does. For example, with these changes:Casting from owned to slice is limited to a fixed set of owning types, since it's hard to cover everything that resembles a slice. Arrays and slices don't implement
Deref<Target=[T]>
, for example, whileAsRef<[T]>
doesn't work for theSelf
type...In addition to that, I also upgraded some actions in the workflows and added Miri checks to CI. It's good to keep an eye on those transmutes and pointer casts and even better to do it automatically. I have only been running it manually so far.