Skip to content

Non-static casts for limited lifetime-free types

Choose a tag to compare

@sagebind sagebind released this 20 Apr 23:26
· 32 commits to master since this release

Breaking changes

  • A new std crate feature has been added which is enabled by default. To compile castaway in no_std contexts this feature must be enabled using default-features = false.

Added

  • You can now cast to certain types known to be lifetime-free (such as primitive types, String, common wrapper types, etc) in certain contexts, even if the source value is generic without a 'static bound. It is possible to cast this way to any type implementing the newly-introduced LifetimeFree trait. (#5, #6)