Skip to content

Commit

Permalink
Fix a couple of typos in the changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Glotfelty committed Jan 27, 2024
1 parent 403ed24 commit 538a165
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 8 deletions.
11 changes: 7 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
added the implementation in your code.
* `Display` now supports format strings using named fields in the enum variant. This should be a no-op for most code.
However, if you were outputting a string like `"Hello {field}"`, this will now be interpretted as a format string.

* EnumDiscriminant now inherits the repr and discriminant values from your main enum. This makes the discriminant type
closer to a mirror of the original and that's always the goal.

### New features

Expand All @@ -33,14 +34,14 @@
}
```

* The `EnumMap` macro has been *experimentally* added. This macro adds a new type that stores an item for each variant
* The `EnumTable` macro has been *experimentally* added. This macro adds a new type that stores an item for each variant
of the enum. This is useful for storing a value for each variant of an enum. This is an experimental feature because
I'm not convinced the current api surface area is correct.

```rust
use strum::EnumMap;
use strum::EnumTable;

#[derive(Copy, Clone, Debug, EnumMap)]
#[derive(Copy, Clone, Debug, EnumTable)]
enum Color {
Red,
Blue,
Expand Down Expand Up @@ -74,6 +75,8 @@
* [#297](https://github.com/Peternator7/strum/pull/297): New macro, add `VariantArray`
* [#296](https://github.com/Peternator7/strum/pull/296): adds prefix attribute to To/From String macros.
* [#294](https://github.com/Peternator7/strum/pull/294): use named enum fields in to_string macro.
* [#288](https://github.com/Peternator7/strum/pull/288): discriminant enums now inherit the repr from the original enum.
* [#279](https://github.com/Peternator7/strum/pull/279): Add `EnumTable` macro to generate a mapping between fieldless variants and data.


## 0.25.3 (strum_macros)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,4 @@ Strumming is also a very whimsical motion, much like writing Rust code.
[FromRepr]: https://docs.rs/strum_macros/latest/strum_macros/derive.FromRepr.html
[VariantArray]: https://docs.rs/strum_macros/latest/strum_macros/derive.StaticVariantsArray.html
[VariantNames]: https://docs.rs/strum_macros/latest/strum_macros/derive.EnumVariantNames.html
[EnumTable]: https://docs.rs/strum_macros/latest/strum_macros/derive.EnumMap.html
[EnumTable]: https://docs.rs/strum_macros/latest/strum_macros/derive.EnumTable.html
2 changes: 1 addition & 1 deletion strum_macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ pub fn enum_try_as(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
/// This macro only supports enums with unit type variants.A new type called `YourEnumTable<T>`. Essentially, it's a wrapper
/// `[T; YourEnum::Count]` where gets/sets are infallible. Some important caveats to note:
///
/// * The size of `YourEnumMap<T>` increases with the number of variants, not the number of values because it's always
/// * The size of `YourEnumTable<T>` increases with the number of variants, not the number of values because it's always
/// fully populated. This means it may not be a good choice for sparsely populated maps.
///
/// * Lookups are basically constant time since it's functionally an array index.
Expand Down
2 changes: 1 addition & 1 deletion strum_nostd_tests/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "strum_nostd_tests"
version = "0.25.0"
version = "0.26.0"
edition = "2018"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
2 changes: 1 addition & 1 deletion strum_tests/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "strum_tests"
version = "0.25.0"
version = "0.26.0"
edition = "2018"
authors = ["Peter Glotfelty <peglotfe@microsoft.com>"]

Expand Down

0 comments on commit 538a165

Please sign in to comment.