- Hide
out_of_boundsreexport from documentation.
- Provide better panic message when providing out-of-bounds index to `Enum::from_usize``.
EnumMap::as_arrayis now usable in const contexts.
-
This crate now follows "N minus two" MSRV policy. This means that it supports the current Rust release, as well as the two before that.
-
Upgraded syn to 2.0.0.
-
Implemented
EnumMap::as_arrayandEnumMap::as_mut_array(implemented by @Fuuzetsu). -
Implemented
PartialOrdandOrdforEnumMap(implemented by @nicarran).
- Added license files to crate tarball.
- Added changelog to crate tarball.
- Improved performance of code generated for
from_usizewhen derivingEnum.
-
Implemented
Enumfor()(unit type) andcore::cmp::Ordering(implemented by @phimuemue). -
Implemented
EnumMap::into_array.
EnumMap::lenis now usable in const contexts.
Enumderive now can deal with re-definitions ofusizeandunimplemented.
EnumMap::from_arrayis now usable in const contexts.
-
Implemented
DoubleEndedIteratorforIntoIter. -
Implemented
EnumMap::into_values.
- Changed behavior of
IntoIterso that it drops rest of the elements when one destructor panics.
- Optimized performance of
enum_map!macro.
- Fixed safety problem when using
enum_map!macro with enums that incorrectly implementedEnumtrait.
- Adjusted crate metadata to avoid lib.rs warnings.
-
Implemented
FromIteratorforEnumMap(implemented by @bit_network on GitLab). -
Implemented
EnumMap::map. -
Derives support product types in addition to sum types (implemented by @bzim on GitLab).
-
It's now possible to access enum length by accessing
LENGTHinEnumtrait.
Enumtrait was split into two traits,EnumandEnumArray.
- Worked around a bug in Clippy that caused false positives when using
use_selflint for code that derivedEnumtrait.
- Implemented
Arbitraryfor maps where the value type also implementsArbitrary. (You have to enable the "arbitrary" feature.)
-
It's now possible to use
returnand?withinmacro_rules!macro. -
Enumtrait is much simpler having two methods only.
-
Removed previously deprecated features.
-
Renamed
to_usizetointo_usizematching the naming convention used in Rust programming language.
- Deprecated
EnumMap::is_emptyandEnumMap::new.EnumMap::newusages can be replaced withEnumMap::default.
- Deprecated
EnumMap::as_ptrandEnumMap::as_mut_ptr.
IterandValuesnow implementsClone(added by @amanieu).
- Added
EnumMap#clearmethod (added by @Riey, thanks :)).
- Now requires Rust 1.36.
- Fixed the issue where an aliasing
Fromtrait implementation caused compilation errors withenum_map!macro.
- Now requires Rust 1.31.
- Default
serdefeatures are disabled. This allows enabling serde feature when compiling withoutstd.
Change of #[derive(EnumMap)] to #[derive(Enum)] was supposed to appear in 0.3.0,
but it was forgotten about. This release fixes just that.
- Changed
#[derive(EnumMap)]to#[derive(Enum)]to match trait name.
- Updated README use
#[derive(EnumMap)]instead of#[derive(Enum)].
-
Implemented compact serde serialization for binary formats like bincode.
-
Iterator traits with exception now implement
FusedIterator.
-
Increased required Rust version to 1.26.0.
-
Renamed
Internaltrait toEnum. -
Added new associated constant
POSSIBLE_VALUEStoEnumtrait, representing the number of possible values the type can have. Manual implementations are required to provide it. -
Removed
Enumimplementation forOption<T>. -
Implemented compact serialization, for formats like
bincode. This makes it impossible to deserialize non-compact representation used by enum-map 0.2.0. -
valuesmethod returnsValues<V>as opposed toslice::Iter<V>.