Skip to content

Releases: sagebind/castaway

Fix tests requiring std to be conditional

04 Jun 15:32
Compare
Choose a tag to compare

Fixed

  • Ensure that any test or example that requires std in order to compile and run are conditionally compiled behind the std crate feature. (#8, #9)

Implement LifetimeFree for NonZeroUsize

22 Apr 03:57
Compare
Choose a tag to compare

Added

  • Implement LifetimeFree for NonZeroUsize to allow casting to NonZeroUsize from non-'static sources which was missing in the prior release. (#7)

Non-static casts for limited lifetime-free types

20 Apr 23:26
Compare
Choose a tag to compare

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)

Allow casting slices

09 Dec 03:56
Compare
Choose a tag to compare

Added

  • Allow for casting slices and mutable slices of static item types. (#2)

Result name resolution fix

26 Sep 20:55
Compare
Choose a tag to compare

Fixed

  • Fix Result not being imported properly in macros, which could result in compilation errors when Result currently refers to another type in the scope invoked.

Initial release

21 Jun 15:05
Compare
Choose a tag to compare

This is the first release of Castaway. This has the following changes from Castaway's predecessor Transmogrify:

  • Casting is performed with a macro instead of a trait. This improves ergonomics by removing the need to always use a turbofish, allows for more intelligent casting of references, and shrinks the public API to allow for taking advantage of future Rust features to allow for more types of casts without breaking changes.
  • The match_type macro now has a slightly different syntax, and match arms must now use irrefutable patterns.