mirror of
https://github.com/danog/strum.git
synced 2024-12-02 09:27:57 +01:00
Updated changelog and readme with new version as well as tweaked docs slightly.
This commit is contained in:
parent
89b9c14731
commit
441316121b
12
CHANGELOG.md
12
CHANGELOG.md
@ -1,5 +1,17 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 0.19.4 / 0.19.5
|
||||||
|
|
||||||
|
* Updated docs
|
||||||
|
|
||||||
|
## 0.19.3
|
||||||
|
|
||||||
|
* Properly error on malformed strum attributes. [#119](https://github.com/Peternator7/strum/pull/119)
|
||||||
|
* These types of inputs have historically been ignore silently. This may break code that is already
|
||||||
|
incorrect.
|
||||||
|
* Move docs back to rust docs. [#121](https://github.com/Peternator7/strum/pull/121)
|
||||||
|
* Updated the docs a second time to improve discoverability.
|
||||||
|
|
||||||
## 0.19.2
|
## 0.19.2
|
||||||
|
|
||||||
* Fixes [#104](https://github.com/Peternator7/strum/issues/104). PR [#105](https://github.com/Peternator7/strum/issues/105)
|
* Fixes [#104](https://github.com/Peternator7/strum/issues/104). PR [#105](https://github.com/Peternator7/strum/issues/105)
|
||||||
|
25
README.md
25
README.md
@ -24,6 +24,9 @@ Cargo.toml. Strum_macros contains the macros needed to derive all the traits in
|
|||||||
[dependencies]
|
[dependencies]
|
||||||
strum = "0.19"
|
strum = "0.19"
|
||||||
strum_macros = "0.19"
|
strum_macros = "0.19"
|
||||||
|
|
||||||
|
# You can also use the "derive" feature, and import the macros directly from "strum"
|
||||||
|
# strum = { version = "0.19", features = ["derive"] }
|
||||||
```
|
```
|
||||||
|
|
||||||
# Strum Macros
|
# Strum Macros
|
||||||
@ -42,6 +45,7 @@ Strum has implemented the following macros:
|
|||||||
| [EnumMessage] | Add a verbose message to an enum variant. |
|
| [EnumMessage] | Add a verbose message to an enum variant. |
|
||||||
| [EnumDiscriminants] | Generate a new type with only the discriminant names. |
|
| [EnumDiscriminants] | Generate a new type with only the discriminant names. |
|
||||||
| [EnumCount] | Add a constant `usize` equal to the number of variants. |
|
| [EnumCount] | Add a constant `usize` equal to the number of variants. |
|
||||||
|
| [ToString] | Serialize an enum to a String. |
|
||||||
|
|
||||||
# Contributing
|
# Contributing
|
||||||
|
|
||||||
@ -64,13 +68,14 @@ information through strings.
|
|||||||
Strumming is also a very whimsical motion, much like writing Rust code.
|
Strumming is also a very whimsical motion, much like writing Rust code.
|
||||||
|
|
||||||
[Macro-Renames]: https://github.com/Peternator7/strum/wiki/Macro-Renames
|
[Macro-Renames]: https://github.com/Peternator7/strum/wiki/Macro-Renames
|
||||||
[EnumString]: https://github.com/Peternator7/strum/wiki/Derive-EnumString
|
[EnumString]: https://docs.rs/strum_macros/0.19.3/strum_macros/derive.EnumString.html
|
||||||
[Display]: https://github.com/Peternator7/strum/wiki/Derive-Display
|
[Display]: https://docs.rs/strum_macros/0.19.3/strum_macros/derive.Display.html
|
||||||
[AsRefStr]: https://github.com/Peternator7/strum/wiki/Derive-AsRefStr
|
[AsRefStr]: https://docs.rs/strum_macros/0.19.3/strum_macros/derive.AsRefStr.html
|
||||||
[IntoStaticStr]: https://github.com/Peternator7/strum/wiki/Derive-IntoStaticStr
|
[IntoStaticStr]: https://docs.rs/strum_macros/0.19.3/strum_macros/derive.IntoStaticStr.html
|
||||||
[EnumVariantNames]: https://github.com/Peternator7/strum/wiki/Derive-EnumVariantNames
|
[EnumVariantNames]: https://docs.rs/strum_macros/0.19.4/strum_macros/derive.EnumVariantNames.html
|
||||||
[EnumIter]: https://github.com/Peternator7/strum/wiki/Derive-EnumIter
|
[EnumIter]: https://docs.rs/strum_macros/0.19.4/strum_macros/derive.EnumIter.html
|
||||||
[EnumProperty]: https://github.com/Peternator7/strum/wiki/Derive-EnumProperty
|
[EnumProperty]: https://docs.rs/strum_macros/0.19.4/strum_macros/derive.EnumProperty.html
|
||||||
[EnumMessage]: https://github.com/Peternator7/strum/wiki/Derive-EnumMessage
|
[EnumMessage]: https://docs.rs/strum_macros/0.19.4/strum_macros/derive.EnumMessage.html
|
||||||
[EnumDiscriminants]: https://github.com/Peternator7/strum/wiki/Derive-EnumDiscriminants
|
[EnumDiscriminants]: https://docs.rs/strum_macros/0.19.4/strum_macros/derive.EnumDiscriminants.html
|
||||||
[EnumCount]: https://github.com/Peternator7/strum/wiki/Derive-EnumCount
|
[EnumCount]: https://docs.rs/strum_macros/0.19.4/strum_macros/derive.EnumCount.html
|
||||||
|
[ToString]: https://docs.rs/strum_macros/0.19.3/strum_macros/derive.ToString.html
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "strum"
|
name = "strum"
|
||||||
version = "0.19.2"
|
version = "0.19.5"
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
authors = ["Peter Glotfelty <peter.glotfelty@microsoft.com>"]
|
authors = ["Peter Glotfelty <peter.glotfelty@microsoft.com>"]
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
@ -15,13 +15,17 @@ repository = "https://github.com/Peternator7/strum"
|
|||||||
readme = "../README.md"
|
readme = "../README.md"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
strum_macros = { path = "../strum_macros", optional = true, version = "0.19.2" }
|
strum_macros = { path = "../strum_macros", optional = true, version = "0.19" }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
strum_macros = { path = "../strum_macros", version = "0.19.2" }
|
strum_macros = { path = "../strum_macros", version = "0.19" }
|
||||||
|
|
||||||
[badges]
|
[badges]
|
||||||
travis-ci = { repository = "Peternator7/strum" }
|
travis-ci = { repository = "Peternator7/strum" }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
derive = ["strum_macros"]
|
derive = ["strum_macros"]
|
||||||
|
|
||||||
|
[package.metadata.docs.rs]
|
||||||
|
features = ["derive"]
|
||||||
|
rustdoc-args = ["--cfg", "docsrs"]
|
||||||
|
@ -16,11 +16,16 @@
|
|||||||
//!
|
//!
|
||||||
//! ```toml
|
//! ```toml
|
||||||
//! [dependencies]
|
//! [dependencies]
|
||||||
//! strum = "0.18.0"
|
//! strum = "0.19"
|
||||||
//! strum_macros = "0.18.0"
|
//! strum_macros = "0.19"
|
||||||
|
//!
|
||||||
|
//! # You can also access strum_macros exports directly through strum using the "derive" feature
|
||||||
|
//! strum = { version = "0.19", features = ["derive"] }
|
||||||
//! ```
|
//! ```
|
||||||
//!
|
//!
|
||||||
|
|
||||||
|
#![cfg_attr(docsrs, feature(doc_cfg))]
|
||||||
|
|
||||||
// only for documentation purposes
|
// only for documentation purposes
|
||||||
pub mod additional_attributes;
|
pub mod additional_attributes;
|
||||||
|
|
||||||
@ -181,3 +186,32 @@ pub trait VariantNames {
|
|||||||
|
|
||||||
#[cfg(feature = "derive")]
|
#[cfg(feature = "derive")]
|
||||||
pub use strum_macros::*;
|
pub use strum_macros::*;
|
||||||
|
|
||||||
|
macro_rules! DocumentMacroRexports {
|
||||||
|
($($export:ident),+) => {
|
||||||
|
$(
|
||||||
|
#[cfg(all(docsrs, feature = "derive"))]
|
||||||
|
#[cfg_attr(docsrs, doc(cfg(feature = "derive")))]
|
||||||
|
pub use strum_macros::$export;
|
||||||
|
)+
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
// We actually only re-export these items individually if we're building
|
||||||
|
// for docsrs. You can do a weird thing where you rename the macro
|
||||||
|
// and then reference it through strum. The renaming feature should be deprecated now that
|
||||||
|
// 2018 edition is almost 2 years old, but we'll need to give people some time to do that.
|
||||||
|
DocumentMacroRexports!{
|
||||||
|
AsRefStr,
|
||||||
|
AsStaticStr,
|
||||||
|
Display,
|
||||||
|
EnumCount,
|
||||||
|
EnumDiscriminants,
|
||||||
|
EnumIter,
|
||||||
|
EnumMessage,
|
||||||
|
EnumProperty,
|
||||||
|
EnumString,
|
||||||
|
EnumVariantNames,
|
||||||
|
IntoStaticStr,
|
||||||
|
ToString
|
||||||
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "strum_macros"
|
name = "strum_macros"
|
||||||
version = "0.19.2"
|
version = "0.19.4"
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
authors = ["Peter Glotfelty <peter.glotfelty@microsoft.com>"]
|
authors = ["Peter Glotfelty <peter.glotfelty@microsoft.com>"]
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "strum_tests"
|
name = "strum_tests"
|
||||||
version = "0.19.0"
|
version = "0.19.4"
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
authors = ["Peter Glotfelty <peglotfe@microsoft.com>"]
|
authors = ["Peter Glotfelty <peglotfe@microsoft.com>"]
|
||||||
|
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "strum_tests_rename"
|
name = "strum_tests_rename"
|
||||||
version = "0.19.0"
|
version = "0.19.4"
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
authors = ["Peter Glotfelty <peglotfe@microsoft.com>"]
|
authors = ["Peter Glotfelty <peglotfe@microsoft.com>"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
strum = { path = "../strum" }
|
strum = { path = "../strum", features = ["derive"] }
|
||||||
|
|
||||||
[dependencies.strum_macros]
|
[dependencies.strum_macros]
|
||||||
path = "../strum_macros"
|
path = "../strum_macros"
|
||||||
|
Loading…
Reference in New Issue
Block a user