mirror of
https://github.com/danog/strum.git
synced 2024-11-30 04:28:59 +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
|
||||
|
||||
## 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
|
||||
|
||||
* 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]
|
||||
strum = "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
|
||||
@ -42,6 +45,7 @@ Strum has implemented the following macros:
|
||||
| [EnumMessage] | Add a verbose message to an enum variant. |
|
||||
| [EnumDiscriminants] | Generate a new type with only the discriminant names. |
|
||||
| [EnumCount] | Add a constant `usize` equal to the number of variants. |
|
||||
| [ToString] | Serialize an enum to a String. |
|
||||
|
||||
# Contributing
|
||||
|
||||
@ -64,13 +68,14 @@ information through strings.
|
||||
Strumming is also a very whimsical motion, much like writing Rust code.
|
||||
|
||||
[Macro-Renames]: https://github.com/Peternator7/strum/wiki/Macro-Renames
|
||||
[EnumString]: https://github.com/Peternator7/strum/wiki/Derive-EnumString
|
||||
[Display]: https://github.com/Peternator7/strum/wiki/Derive-Display
|
||||
[AsRefStr]: https://github.com/Peternator7/strum/wiki/Derive-AsRefStr
|
||||
[IntoStaticStr]: https://github.com/Peternator7/strum/wiki/Derive-IntoStaticStr
|
||||
[EnumVariantNames]: https://github.com/Peternator7/strum/wiki/Derive-EnumVariantNames
|
||||
[EnumIter]: https://github.com/Peternator7/strum/wiki/Derive-EnumIter
|
||||
[EnumProperty]: https://github.com/Peternator7/strum/wiki/Derive-EnumProperty
|
||||
[EnumMessage]: https://github.com/Peternator7/strum/wiki/Derive-EnumMessage
|
||||
[EnumDiscriminants]: https://github.com/Peternator7/strum/wiki/Derive-EnumDiscriminants
|
||||
[EnumCount]: https://github.com/Peternator7/strum/wiki/Derive-EnumCount
|
||||
[EnumString]: https://docs.rs/strum_macros/0.19.3/strum_macros/derive.EnumString.html
|
||||
[Display]: https://docs.rs/strum_macros/0.19.3/strum_macros/derive.Display.html
|
||||
[AsRefStr]: https://docs.rs/strum_macros/0.19.3/strum_macros/derive.AsRefStr.html
|
||||
[IntoStaticStr]: https://docs.rs/strum_macros/0.19.3/strum_macros/derive.IntoStaticStr.html
|
||||
[EnumVariantNames]: https://docs.rs/strum_macros/0.19.4/strum_macros/derive.EnumVariantNames.html
|
||||
[EnumIter]: https://docs.rs/strum_macros/0.19.4/strum_macros/derive.EnumIter.html
|
||||
[EnumProperty]: https://docs.rs/strum_macros/0.19.4/strum_macros/derive.EnumProperty.html
|
||||
[EnumMessage]: https://docs.rs/strum_macros/0.19.4/strum_macros/derive.EnumMessage.html
|
||||
[EnumDiscriminants]: https://docs.rs/strum_macros/0.19.4/strum_macros/derive.EnumDiscriminants.html
|
||||
[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]
|
||||
name = "strum"
|
||||
version = "0.19.2"
|
||||
version = "0.19.5"
|
||||
edition = "2018"
|
||||
authors = ["Peter Glotfelty <peter.glotfelty@microsoft.com>"]
|
||||
license = "MIT"
|
||||
@ -15,13 +15,17 @@ repository = "https://github.com/Peternator7/strum"
|
||||
readme = "../README.md"
|
||||
|
||||
[dependencies]
|
||||
strum_macros = { path = "../strum_macros", optional = true, version = "0.19.2" }
|
||||
strum_macros = { path = "../strum_macros", optional = true, version = "0.19" }
|
||||
|
||||
[dev-dependencies]
|
||||
strum_macros = { path = "../strum_macros", version = "0.19.2" }
|
||||
strum_macros = { path = "../strum_macros", version = "0.19" }
|
||||
|
||||
[badges]
|
||||
travis-ci = { repository = "Peternator7/strum" }
|
||||
|
||||
[features]
|
||||
derive = ["strum_macros"]
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
features = ["derive"]
|
||||
rustdoc-args = ["--cfg", "docsrs"]
|
||||
|
@ -16,11 +16,16 @@
|
||||
//!
|
||||
//! ```toml
|
||||
//! [dependencies]
|
||||
//! strum = "0.18.0"
|
||||
//! strum_macros = "0.18.0"
|
||||
//! strum = "0.19"
|
||||
//! 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
|
||||
pub mod additional_attributes;
|
||||
|
||||
@ -181,3 +186,32 @@ pub trait VariantNames {
|
||||
|
||||
#[cfg(feature = "derive")]
|
||||
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]
|
||||
name = "strum_macros"
|
||||
version = "0.19.2"
|
||||
version = "0.19.4"
|
||||
edition = "2018"
|
||||
authors = ["Peter Glotfelty <peter.glotfelty@microsoft.com>"]
|
||||
license = "MIT"
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "strum_tests"
|
||||
version = "0.19.0"
|
||||
version = "0.19.4"
|
||||
edition = "2018"
|
||||
authors = ["Peter Glotfelty <peglotfe@microsoft.com>"]
|
||||
|
||||
|
@ -1,11 +1,11 @@
|
||||
[package]
|
||||
name = "strum_tests_rename"
|
||||
version = "0.19.0"
|
||||
version = "0.19.4"
|
||||
edition = "2018"
|
||||
authors = ["Peter Glotfelty <peglotfe@microsoft.com>"]
|
||||
|
||||
[dependencies]
|
||||
strum = { path = "../strum" }
|
||||
strum = { path = "../strum", features = ["derive"] }
|
||||
|
||||
[dependencies.strum_macros]
|
||||
path = "../strum_macros"
|
||||
|
Loading…
Reference in New Issue
Block a user