commit_hash
stringlengths
40
40
author
stringlengths
1
57
date
timestamp[s]date
2010-07-26 04:45:09
2026-04-14 18:21:10
message
stringlengths
8
1.39M
diff
stringlengths
68
51.2k
files_changed
int64
1
136
insertions
int64
0
2.35k
deletions
int64
0
1.9k
1e46337eb2ec71caccf2fc35929e2f0cbedbb3c2
Samuel Moelius
2024-03-31T21:44:33
Update `heck` requirement (#346)
diff --git a/strum_macros/Cargo.toml b/strum_macros/Cargo.toml index 5f36880..16a52c7 100644 --- a/strum_macros/Cargo.toml +++ b/strum_macros/Cargo.toml @@ -19,7 +19,7 @@ proc-macro = true name = "strum_macros" [dependencies] -heck = "0.4.1" +heck = "0.5.0" proc-macro2 = "1.0" quote = "1.0" rustversion = "1.0"
1
1
1
f5fce032ed381a334e81676bd2c391353c265476
Owen Friedman
2024-03-31T21:42:15
Fix typos & misspellings in docs (#347)
diff --git a/strum/src/additional_attributes.rs b/strum/src/additional_attributes.rs index a29f1d6..3971ba1 100644 --- a/strum/src/additional_attributes.rs +++ b/strum/src/additional_attributes.rs @@ -78,7 +78,7 @@ //! //! - `ascii_case_insensitive`: makes the comparison to this variant case insensitive (ASCII only)....
2
4
4
8daf564fca6b5e50ee9af0e01c1957d7cfcefd60
Peter Glotfelty
2024-03-10T21:30:54
Hide EnumTable because I think it should be deprecated in the next release (#344) Co-authored-by: Peter Glotfelty <peter@glotfelty.us>
diff --git a/strum_macros/src/lib.rs b/strum_macros/src/lib.rs index 209eb21..b337fb3 100644 --- a/strum_macros/src/lib.rs +++ b/strum_macros/src/lib.rs @@ -569,6 +569,7 @@ pub fn enum_try_as(input: proc_macro::TokenStream) -> proc_macro::TokenStream { /// complex_map[Color::Green] = complex_map[Color::Red]; /// asse...
1
1
0
1abb289ebc3e3711a9b2215ee929ba94fba15d68
Peter Glotfelty
2024-03-10T21:21:00
Fix docs that say array instead of slice (#343) Co-authored-by: Peter Glotfelty <peter@glotfelty.us>
diff --git a/strum_macros/src/lib.rs b/strum_macros/src/lib.rs index c653d4a..209eb21 100644 --- a/strum_macros/src/lib.rs +++ b/strum_macros/src/lib.rs @@ -178,7 +178,7 @@ pub fn as_ref_str(input: proc_macro::TokenStream) -> proc_macro::TokenStream { toks.into() } -/// Implements `Strum::VariantNames` which ad...
1
2
2
63ee822851d45d1763145a730138ada1e41d254b
Vladimir
2024-03-10T18:30:56
feat(as_ref_str): enable `prefix` attribute for `AsRefStr` derive (#334) * feat(as_ref_str): enable `prefix` attribute for `AsRefStr` derive * doc(as_ref_str): add prefix example
diff --git a/strum_macros/src/helpers/variant_props.rs b/strum_macros/src/helpers/variant_props.rs index d6e0cab..681c7c0 100644 --- a/strum_macros/src/helpers/variant_props.rs +++ b/strum_macros/src/helpers/variant_props.rs @@ -30,14 +30,24 @@ impl StrumVariantProperties { LitStr::new(&ident.convert_case(case...
7
37
11
9b18468f78f532750901f7822607ceeda038285a
Hasan Mohsin
2024-03-10T18:29:24
Fix missing generics on impl for EnumTryAs (#337)
diff --git a/strum_macros/src/macros/enum_try_as.rs b/strum_macros/src/macros/enum_try_as.rs index 1efbbe8..c6d0127 100644 --- a/strum_macros/src/macros/enum_try_as.rs +++ b/strum_macros/src/macros/enum_try_as.rs @@ -10,6 +10,7 @@ pub fn enum_try_as_inner(ast: &DeriveInput) -> syn::Result<TokenStream> { }; ...
1
3
3
3730bd4d5f061c36e203e73b2a65e27a841e531a
Bogdan Mircea
2024-02-04T16:03:48
Make format_args! invocation backwards compatible
diff --git a/strum_macros/src/helpers/mod.rs b/strum_macros/src/helpers/mod.rs index 70b0f33..9ac17dc 100644 --- a/strum_macros/src/helpers/mod.rs +++ b/strum_macros/src/helpers/mod.rs @@ -28,7 +28,7 @@ pub fn non_unit_variant_error() -> syn::Error { pub fn non_single_field_variant_error(attr: &str) -> syn::Error { ...
1
1
1
2056939963527cc89f192239cb3c0262467ddb9d
DTrippe
2024-02-04T15:31:39
Fix AsRefStr docs to specify lifetime constraints (#330)
diff --git a/strum_macros/src/lib.rs b/strum_macros/src/lib.rs index 72f8a37..11a1cd7 100644 --- a/strum_macros/src/lib.rs +++ b/strum_macros/src/lib.rs @@ -118,12 +118,15 @@ pub fn from_string(input: proc_macro::TokenStream) -> proc_macro::TokenStream { toks.into() } -/// Converts enum variants to `&'static st...
1
4
1
0988e896c226fb2af8ee1c6f3ea55d7e3b6a1596
Bogdan Mircea
2024-02-04T14:15:35
Removed derive Default trait in tests
diff --git a/strum_tests/tests/as_ref_str.rs b/strum_tests/tests/as_ref_str.rs index 284a326..ab8b7dd 100644 --- a/strum_tests/tests/as_ref_str.rs +++ b/strum_tests/tests/as_ref_str.rs @@ -5,14 +5,19 @@ use strum::{AsRefStr, AsStaticRef, AsStaticStr, EnumString, IntoStaticStr}; mod core {} // ensure macros call `::c...
2
18
5
116ce422599a4bda9a515e145374eff198790105
Bogdan Mircea
2024-02-04T14:13:07
Made transparent attr error more descriptive
diff --git a/strum_macros/src/helpers/mod.rs b/strum_macros/src/helpers/mod.rs index 8e98c2f..70b0f33 100644 --- a/strum_macros/src/helpers/mod.rs +++ b/strum_macros/src/helpers/mod.rs @@ -25,10 +25,10 @@ pub fn non_unit_variant_error() -> syn::Error { ) } -pub fn non_single_field_variant_error() -> syn::Error ...
4
5
5
67d88549c955a1fbb39489eee5788875921c12f8
Bogdan Mircea
2024-02-04T13:55:07
Added tests for the transparent attr
diff --git a/strum_tests/tests/as_ref_no_strum.rs b/strum_tests/tests/as_ref_no_strum.rs index e8261f4..9d1ea15 100644 --- a/strum_tests/tests/as_ref_no_strum.rs +++ b/strum_tests/tests/as_ref_no_strum.rs @@ -12,6 +12,8 @@ enum Color { Yellow, #[strum(default)] Green(String), + #[strum(transparent)] +...
3
58
0
b403adaaf3b24a991336e6d916febf7f3f4d8574
Bogdan Mircea
2024-02-04T13:34:19
Added docs for the transparent attribute
diff --git a/strum/src/additional_attributes.rs b/strum/src/additional_attributes.rs index a29f1d6..98bee85 100644 --- a/strum/src/additional_attributes.rs +++ b/strum/src/additional_attributes.rs @@ -73,6 +73,10 @@ //! ``` //! The plugin will fail if the data doesn't implement From<&str>. You can only have o...
1
4
0
7761f908da3ef9983bdff25399bdace6839362af
Bogdan Mircea
2024-02-04T13:29:05
Separated as_ref_str and into_static_str in different modules
diff --git a/strum_macros/src/lib.rs b/strum_macros/src/lib.rs index 72f8a37..24ef191 100644 --- a/strum_macros/src/lib.rs +++ b/strum_macros/src/lib.rs @@ -249,9 +249,9 @@ pub fn static_variants_array(input: proc_macro::TokenStream) -> proc_macro::Toke pub fn as_static_str(input: proc_macro::TokenStream) -> proc_macr...
5
128
59
2cb311f44b95a8e8143949d11877bc28b10b54b1
Bogdan Mircea
2024-02-04T13:11:23
Added handling of the transparent attribute
diff --git a/strum_macros/src/macros/strings/as_ref_str.rs b/strum_macros/src/macros/strings/as_ref_str.rs index 617b887..60b6185 100644 --- a/strum_macros/src/macros/strings/as_ref_str.rs +++ b/strum_macros/src/macros/strings/as_ref_str.rs @@ -2,7 +2,9 @@ use proc_macro2::TokenStream; use quote::quote; use syn::{par...
2
48
11
819dedbefeffd497fbba38391d93c5203f9a9527
Bogdan Mircea
2024-02-04T13:11:08
Added VariantMeta::Transparent
diff --git a/strum_macros/src/helpers/metadata.rs b/strum_macros/src/helpers/metadata.rs index 94100a7..9ded40c 100644 --- a/strum_macros/src/helpers/metadata.rs +++ b/strum_macros/src/helpers/metadata.rs @@ -29,6 +29,7 @@ pub mod kw { custom_keyword!(detailed_message); custom_keyword!(serialize); custom...
2
14
0
5fb99442e9f034524fc0a88694947f08a8cfb40b
Bogdan Mircea
2024-02-04T13:10:27
Added error for non-single field enum variants
diff --git a/strum_macros/src/helpers/mod.rs b/strum_macros/src/helpers/mod.rs index 23d60b5..8e98c2f 100644 --- a/strum_macros/src/helpers/mod.rs +++ b/strum_macros/src/helpers/mod.rs @@ -25,6 +25,13 @@ pub fn non_unit_variant_error() -> syn::Error { ) } +pub fn non_single_field_variant_error() -> syn::Error {...
1
7
0
175b4a38caae8d1188eb0cd017fcdc4d0feedca9
ripytide
2024-01-28T15:21:20
fix: use core not std to allow no_std to compile (#325)
diff --git a/strum/src/lib.rs b/strum/src/lib.rs index 7e190d9..959a647 100644 --- a/strum/src/lib.rs +++ b/strum/src/lib.rs @@ -223,7 +223,7 @@ pub trait VariantNames { /// enums with inner data in one or more variants. Consider using it alongside /// [`EnumDiscriminants`] if you require inner data but still want to...
1
1
1
33b93b404f503785485c415cbaf7e111135bc80e
Amin Yahyaabadi
2024-01-27T16:54:00
fix: avoid conflicts in case of consecutive underscores (#321) * fix: avoid conflicts in case of consecutive underscores * fix: suppress the warning for constant case
diff --git a/strum_macros/src/macros/from_repr.rs b/strum_macros/src/macros/from_repr.rs index a70c6f8..78bbb28 100644 --- a/strum_macros/src/macros/from_repr.rs +++ b/strum_macros/src/macros/from_repr.rs @@ -1,4 +1,3 @@ -use heck::ToShoutySnakeCase; use proc_macro2::{Span, TokenStream}; use quote::{format_ident, quo...
1
5
3
a155e813707f02cdf15a97cbea5a4b645cfa7722
PingPongun
2024-01-07T20:59:52
fix EnumIter for enums with const generic (#293)
diff --git a/strum_macros/src/macros/enum_iter.rs b/strum_macros/src/macros/enum_iter.rs index 0a59deb..5e81001 100644 --- a/strum_macros/src/macros/enum_iter.rs +++ b/strum_macros/src/macros/enum_iter.rs @@ -74,7 +74,7 @@ pub fn enum_iter_inner(ast: &DeriveInput) -> syn::Result<TokenStream> { #[allow( ...
2
5
5
43d4a059690781a9cf38c3c415997a967ba22a1e
JJ Ferman
2024-01-07T20:51:48
fixing doc link (#312) Co-authored-by: JJ Ferman <10889748+fermanjj@users.noreply.github.com>
diff --git a/strum_macros/src/lib.rs b/strum_macros/src/lib.rs index 82db12a..673419a 100644 --- a/strum_macros/src/lib.rs +++ b/strum_macros/src/lib.rs @@ -44,7 +44,7 @@ fn debug_print_generated(ast: &DeriveInput, toks: &TokenStream) { /// variant. There is an option to match on different case conversions through the...
1
1
1
e34e66c342bc09fe9744aedab88ecc6ff1b272e1
disoul
2024-01-07T20:51:23
Fixed the `fmt` conflict caused by using `use std::fmt::Debug` (#322)
diff --git a/strum_macros/src/macros/strings/display.rs b/strum_macros/src/macros/strings/display.rs index e6a2459..2fd0eef 100644 --- a/strum_macros/src/macros/strings/display.rs +++ b/strum_macros/src/macros/strings/display.rs @@ -38,7 +38,7 @@ pub fn display_inner(ast: &DeriveInput) -> syn::Result<TokenStream> { ...
1
2
2
216e4ded33eb3d4ae7d40c66947b3ae3199d985d
Chris Chan
2023-12-28T22:34:03
Add the `prefix` attribute (#296) * implement prefix enum attribute * `cargo fmt` * undo changes --------- Co-authored-by: Peter Glotfelty <glotfelty.2@osu.edu>
diff --git a/strum_macros/src/helpers/case_style.rs b/strum_macros/src/helpers/case_style.rs index 86a8583..bcea788 100644 --- a/strum_macros/src/helpers/case_style.rs +++ b/strum_macros/src/helpers/case_style.rs @@ -1,5 +1,6 @@ use heck::{ - ToKebabCase, ToLowerCamelCase, ToShoutySnakeCase, ToSnakeCase, ToTitleCas...
12
78
20
ffe8873ae7f5338b8397d708a1d278657f85e81f
Josh Channings
2023-12-03T00:28:57
Add Iterator trait bounds to IntoEnumIterator (#314) The concrete Iterator type for all implementations of IntoEnumIterator is guaranteed to implement these traits, because the only implementor is the `#[derive(EnumIter)]` macro, which emits an impl for each for the generated {EnumType}Iter struct. However, when...
diff --git a/strum/src/lib.rs b/strum/src/lib.rs index 7fbe5e2..78a7020 100644 --- a/strum/src/lib.rs +++ b/strum/src/lib.rs @@ -30,6 +30,8 @@ // only for documentation purposes pub mod additional_attributes; +use core::iter::FusedIterator; + #[cfg(feature = "phf")] #[doc(hidden)] pub use phf as _private_phf_ree...
1
3
1
cb8b753ee0d9d5d8231b6cf392f116cea86f1fac
Brenno Lemos
2023-11-18T01:38:12
fix(doctest): avoid importing traits twice because of macro derive
diff --git a/strum_macros/src/lib.rs b/strum_macros/src/lib.rs index b03d260..4ec505c 100644 --- a/strum_macros/src/lib.rs +++ b/strum_macros/src/lib.rs @@ -204,7 +204,6 @@ pub fn variant_names(input: proc_macro::TokenStream) -> proc_macro::TokenStream /// /// ``` /// use strum::StaticVariantsArray; -/// use strum_...
1
1
2
ef1e13638e8391af7e029b327230c7a5aa343b40
Brenno Lemos
2023-11-18T00:49:10
chore: attempt to resolve tests by using relative dependency
diff --git a/strum_macros/Cargo.toml b/strum_macros/Cargo.toml index c1b9762..3c51382 100644 --- a/strum_macros/Cargo.toml +++ b/strum_macros/Cargo.toml @@ -26,4 +26,4 @@ rustversion = "1.0" syn = { version = "2.0", features = ["parsing", "extra-traits"] } [dev-dependencies] -strum = "0.25" +strum = { path = "../st...
1
1
1
84cf8d2a321ec27ec49c67b3fb19d082b6d9668a
Peter Glotfelty
2023-10-29T19:29:44
Support FusedIteratorOnly
diff --git a/strum_macros/src/macros/enum_iter.rs b/strum_macros/src/macros/enum_iter.rs index 8497404..0a59deb 100644 --- a/strum_macros/src/macros/enum_iter.rs +++ b/strum_macros/src/macros/enum_iter.rs @@ -71,7 +71,9 @@ pub fn enum_iter_inner(ast: &DeriveInput) -> syn::Result<TokenStream> { Ok(quote! { ...
1
13
1
e8b2ff1b4810b37eef6a9be2fc4e6ae9f6724090
Jason Scatena
2023-10-29T01:57:36
EnumDiscriminant inherits the repr and discriminant values (#288) * moved repr extraction to helpers * repr pass-through added * add discriminant pass through * remove dev artifact --------- Co-authored-by: Jason Scatena <jscatena@amazon.com>
diff --git a/strum_macros/src/helpers/type_props.rs b/strum_macros/src/helpers/type_props.rs index 0d49e04..17d84c9 100644 --- a/strum_macros/src/helpers/type_props.rs +++ b/strum_macros/src/helpers/type_props.rs @@ -21,6 +21,7 @@ pub struct StrumTypeProperties { pub discriminant_others: Vec<TokenStream>, pub...
4
98
51
d32af44f2e8273cdcc9edec6af65692ba90f7e00
Peter Glotfelty
2023-10-29T01:55:52
Fix "Display" for non string Defaults (#308) * Fix "Display" for non string Defaults * This version actually works :) --------- Co-authored-by: Peter Glotfelty <peter@glotfelty.us>
diff --git a/strum_macros/src/macros/strings/display.rs b/strum_macros/src/macros/strings/display.rs index fcc5936..77f8afa 100644 --- a/strum_macros/src/macros/strings/display.rs +++ b/strum_macros/src/macros/strings/display.rs @@ -35,7 +35,7 @@ pub fn display_inner(ast: &DeriveInput) -> syn::Result<TokenStream> { ...
2
23
8
7831f6f1f7c7dddce1308738bd6d9ff654f71274
John T. Wodder II
2023-10-28T22:35:32
Impl Copy, Eq, and FusedIterator for EnumIter iterators
diff --git a/strum_macros/src/macros/enum_iter.rs b/strum_macros/src/macros/enum_iter.rs index 0e700aa..8497404 100644 --- a/strum_macros/src/macros/enum_iter.rs +++ b/strum_macros/src/macros/enum_iter.rs @@ -71,9 +71,7 @@ pub fn enum_iter_inner(ast: &DeriveInput) -> syn::Result<TokenStream> { Ok(quote! { ...
1
2
12
42c16664a8f978928d575b63043d9d4282cb50d9
horacimacias
2023-10-15T22:08:35
Fix EnumIter for enums named Option (#300) Co-authored-by: Horaci Macias <hmacias@avaya.com>
diff --git a/strum_macros/src/macros/enum_iter.rs b/strum_macros/src/macros/enum_iter.rs index ce8237f..0e700aa 100644 --- a/strum_macros/src/macros/enum_iter.rs +++ b/strum_macros/src/macros/enum_iter.rs @@ -91,7 +91,7 @@ pub fn enum_iter_inner(ast: &DeriveInput) -> syn::Result<TokenStream> { } imp...
2
18
5
0199235bb0da0e1bcfc3d6402c9a740e72ac8ecd
Wyatt Herkamp
2023-10-15T22:07:46
Fix Generics Issue with enum_is (#305)
diff --git a/strum_macros/src/macros/enum_is.rs b/strum_macros/src/macros/enum_is.rs index 6cf5645..ecada45 100644 --- a/strum_macros/src/macros/enum_is.rs +++ b/strum_macros/src/macros/enum_is.rs @@ -8,6 +8,7 @@ pub fn enum_is_inner(ast: &DeriveInput) -> syn::Result<TokenStream> { Data::Enum(v) => &v.variants...
2
17
3
3664c5e8cab44bc32b217acbf67efcdf143e3764
Michael Schubart
2023-10-15T22:06:49
Remove unused vectors (#304)
diff --git a/strum_macros/src/macros/enum_properties.rs b/strum_macros/src/macros/enum_properties.rs index 0fe389e..2583096 100644 --- a/strum_macros/src/macros/enum_properties.rs +++ b/strum_macros/src/macros/enum_properties.rs @@ -19,8 +19,6 @@ pub fn enum_properties_inner(ast: &DeriveInput) -> syn::Result<TokenStrea...
1
0
4
af9b15b617ed35458fcb5c9247fca5348c357c89
Wyatt Herkamp
2023-10-15T22:05:55
Add doc comment to EnumIs result (#301)
diff --git a/strum_macros/src/macros/enum_is.rs b/strum_macros/src/macros/enum_is.rs index b69fa0c..6cf5645 100644 --- a/strum_macros/src/macros/enum_is.rs +++ b/strum_macros/src/macros/enum_is.rs @@ -10,7 +10,6 @@ pub fn enum_is_inner(ast: &DeriveInput) -> syn::Result<TokenStream> { }; let enum_name = &ast...
3
6
4
726d6444935450dce151de573b73f98eac29ef4c
Brenno Lemos
2023-09-21T20:46:59
test: variants with values
diff --git a/strum_tests/tests/static_variants_array.rs b/strum_tests/tests/static_variants_array.rs index 8f67c4d..f5f72c1 100644 --- a/strum_tests/tests/static_variants_array.rs +++ b/strum_tests/tests/static_variants_array.rs @@ -20,7 +20,7 @@ fn simple() { Operation::Mul, Operation::Div, ...
1
30
3
ead165479741e72503358b32e94ba04ea039b28d
Arian Rezazadeh
2023-09-08T07:01:59
fix panic in unicode strings
diff --git a/strum_macros/src/macros/strings/display.rs b/strum_macros/src/macros/strings/display.rs index 080fcdf..e58e4d2 100644 --- a/strum_macros/src/macros/strings/display.rs +++ b/strum_macros/src/macros/strings/display.rs @@ -108,8 +108,8 @@ fn capture_format_string_idents(string_literal: &LitStr) -> syn::Result...
1
3
3
b744e65d6f96c1fe5314df7bb9437bc80c8a2536
Arian Rezazadeh
2023-09-07T21:40:04
make it compatible with 1.56.1
diff --git a/strum_macros/src/macros/strings/display.rs b/strum_macros/src/macros/strings/display.rs index 8bd3a65..080fcdf 100644 --- a/strum_macros/src/macros/strings/display.rs +++ b/strum_macros/src/macros/strings/display.rs @@ -1,6 +1,6 @@ use proc_macro2::{Ident, TokenStream}; use quote::quote; -use syn::{punct...
1
70
7
824796ad9a59190fe45f459e32de1399c15e6fa6
Arian Rezazadeh
2023-09-07T21:24:54
append it to rust doc test for Display
diff --git a/strum_macros/src/lib.rs b/strum_macros/src/lib.rs index 82db12a..75a984f 100644 --- a/strum_macros/src/lib.rs +++ b/strum_macros/src/lib.rs @@ -317,6 +317,10 @@ pub fn to_string(input: proc_macro::TokenStream) -> proc_macro::TokenStream { /// }, /// Blue(usize), /// Yellow, +/// #[strum(...
1
7
0
2e424815cfb80b1a90165d230ec5c29ca48b5541
Arian Rezazadeh
2023-09-07T21:20:52
implement it for Display macro
diff --git a/strum_macros/src/macros/strings/display.rs b/strum_macros/src/macros/strings/display.rs index fcc5936..8bd3a65 100644 --- a/strum_macros/src/macros/strings/display.rs +++ b/strum_macros/src/macros/strings/display.rs @@ -1,6 +1,6 @@ -use proc_macro2::TokenStream; +use proc_macro2::{Ident, TokenStream}; use...
1
18
4
17bcee5578e3d503b1724b40e841efacf41931d6
Arian Rezazadeh
2023-09-07T21:03:34
add test cases
diff --git a/strum_tests/tests/display.rs b/strum_tests/tests/display.rs index 4cec148..8ba2f3b 100644 --- a/strum_tests/tests/display.rs +++ b/strum_tests/tests/display.rs @@ -10,6 +10,8 @@ enum Color { Blue { hue: usize }, #[strum(serialize = "y", serialize = "yellow")] Yellow, + #[strum(to_string =...
1
10
0
5df066696339793bf7bd2714b6a38e1e848cf964
PokeJofeJr4th
2023-08-27T02:59:20
Replace format macro invocations with arguments rather than inline so they'll work with rust 1.56.1
diff --git a/strum_macros/src/macros/enum_table.rs b/strum_macros/src/macros/enum_table.rs index 78b91be..f9d4e81 100644 --- a/strum_macros/src/macros/enum_table.rs +++ b/strum_macros/src/macros/enum_table.rs @@ -8,7 +8,7 @@ pub fn enum_table_inner(ast: &DeriveInput) -> syn::Result<TokenStream> { let name = &ast.i...
1
23
12
c4d4ca555d7839c86ca9f551c99478f0510c3bcd
PokeJofeJr4th
2023-08-27T00:00:49
absolute paths, get rid of `let ... else`
diff --git a/strum_macros/src/macros/enum_table.rs b/strum_macros/src/macros/enum_table.rs index 48d4721..78b91be 100644 --- a/strum_macros/src/macros/enum_table.rs +++ b/strum_macros/src/macros/enum_table.rs @@ -17,12 +17,12 @@ pub fn enum_table_inner(ast: &DeriveInput) -> syn::Result<TokenStream> { )); ...
1
16
16
27824123968303d321a460466657b438e160fa99
hasezoey
2023-08-06T23:48:02
Enable doc-test for "strum_discriminants(vis(pub))" (#289)
diff --git a/strum_macros/src/lib.rs b/strum_macros/src/lib.rs index a37ccdc..1c1fd09 100644 --- a/strum_macros/src/lib.rs +++ b/strum_macros/src/lib.rs @@ -713,7 +713,7 @@ pub fn enum_properties(input: proc_macro::TokenStream) -> proc_macro::TokenStrea /// of the generated enum. By default, the generated enum inherit...
1
1
1
4014b3e2d10edbc85f1548fd020e6b6ba170e161
Mendy Berger
2023-07-31T20:44:38
Requested changes in review
diff --git a/strum_macros/src/helpers/case_style.rs b/strum_macros/src/helpers/case_style.rs index d714f86..388380b 100644 --- a/strum_macros/src/helpers/case_style.rs +++ b/strum_macros/src/helpers/case_style.rs @@ -120,3 +120,20 @@ fn test_convert_case() { assert_eq!("TestMe", id.convert_case(Some(CaseStyle::Pas...
6
27
26
fcb9841a744543b993eb1645db35dbda541e9a30
bouzuya
2023-07-29T22:00:13
Add test and comment if `camel_case` is specified (#250) Co-authored-by: Peter Glotfelty <glotfelty.2@osu.edu>
diff --git a/strum_macros/src/helpers/case_style.rs b/strum_macros/src/helpers/case_style.rs index d714f86..d6b2270 100644 --- a/strum_macros/src/helpers/case_style.rs +++ b/strum_macros/src/helpers/case_style.rs @@ -59,12 +59,14 @@ impl FromStr for CaseStyle { fn from_str(text: &str) -> Result<Self, ()> { ...
2
74
9
fd519ec47fa84c4494063d0af6549d1f9ad0b890
kraktus
2023-07-29T21:58:18
Fix `EnumIter` macro code generation (#287) * Add test to ensure macro call `::core`-related functions Avoiding local core modules to break the macro-generated code. Currently failing due to issue with `EnumIter` macros. * Fix macro of `EnumIter` close https://github.com/Peternator7/strum/issues/284 ---...
diff --git a/strum_macros/src/macros/enum_iter.rs b/strum_macros/src/macros/enum_iter.rs index d136d30..ce8237f 100644 --- a/strum_macros/src/macros/enum_iter.rs +++ b/strum_macros/src/macros/enum_iter.rs @@ -80,8 +80,8 @@ pub fn enum_iter_inner(ast: &DeriveInput) -> syn::Result<TokenStream> { marker: ::co...
16
33
2
e0f81e9caa6cfc26d7fd585da0ba993c32ef70dd
MendyBerger
2023-07-17T02:59:38
Added EnumTryAs
diff --git a/strum_macros/src/helpers/mod.rs b/strum_macros/src/helpers/mod.rs index 11aebc8..69eeabe 100644 --- a/strum_macros/src/helpers/mod.rs +++ b/strum_macros/src/helpers/mod.rs @@ -1,9 +1,11 @@ pub use self::case_style::CaseStyleHelpers; +pub use self::snakify::snakify; pub use self::type_props::HasTypeProper...
7
181
19
5d65bfce42fb9fe94125ce186b3ddc486f1278b0
PokeJofeJr4th
2023-07-17T01:53:21
rename EnumMap to EnumTable
diff --git a/strum_macros/src/lib.rs b/strum_macros/src/lib.rs index bf688e8..a2610a7 100644 --- a/strum_macros/src/lib.rs +++ b/strum_macros/src/lib.rs @@ -412,12 +412,12 @@ pub fn enum_is(input: proc_macro::TokenStream) -> proc_macro::TokenStream { /// Creates a new type that maps all the variants of an enum to anot...
4
69
68
f283ab2d32463c6f159c40928fd31d164be326e0
PokeJofeJr4th
2023-07-17T01:41:35
escape identifiers with `_` to prevent keyword name collisions resolves #8
diff --git a/strum_macros/src/macros/enum_map.rs b/strum_macros/src/macros/enum_map.rs index 014ed4c..93f9c68 100644 --- a/strum_macros/src/macros/enum_map.rs +++ b/strum_macros/src/macros/enum_map.rs @@ -64,7 +64,7 @@ pub fn enum_map_inner(ast: &DeriveInput) -> syn::Result<TokenStream> { }; let pas...
2
3
1
93ea44dd1216e584ced4da2e423157eb39f72c8d
Samuel Moelius
2023-07-03T20:45:32
Handle rustoc comments in `#[derive(FromRepr)]` (#276)
diff --git a/strum_macros/src/macros/from_repr.rs b/strum_macros/src/macros/from_repr.rs index 811467e..92fd7ad 100644 --- a/strum_macros/src/macros/from_repr.rs +++ b/strum_macros/src/macros/from_repr.rs @@ -16,7 +16,15 @@ pub fn from_repr_inner(ast: &DeriveInput) -> syn::Result<TokenStream> { for attr in attrs {...
2
10
1
69da32643c2eebf2b39725544dac683f406e7485
PokeJofeJr4th
2023-07-01T11:55:02
add error for empty enums (resolves #7), added test for keyword collision (#8)
diff --git a/strum_macros/src/macros/enum_map.rs b/strum_macros/src/macros/enum_map.rs index eefa02c..014ed4c 100644 --- a/strum_macros/src/macros/enum_map.rs +++ b/strum_macros/src/macros/enum_map.rs @@ -13,7 +13,7 @@ pub fn enum_map_inner(ast: &DeriveInput) -> syn::Result<TokenStream> { if gen.lifetimes().count(...
2
16
3
5f2f1c1ec16d83871edb6a1c0b21d963e82f5f5e
PokeJofeJr4th
2023-06-30T13:06:18
add test for `clone`, change `all_ok` to return `Result`
diff --git a/strum_macros/src/macros/enum_map.rs b/strum_macros/src/macros/enum_map.rs index 23144d8..eefa02c 100644 --- a/strum_macros/src/macros/enum_map.rs +++ b/strum_macros/src/macros/enum_map.rs @@ -175,16 +175,10 @@ pub fn enum_map_inner(ast: &DeriveInput) -> syn::Result<TokenStream> { impl<T, E> #map...
2
15
14
c3eed1cf3980bef77977af4aa9f493643f43fa7d
PokeJofeJr4th
2023-06-28T21:44:01
fixed format_ident
diff --git a/strum_macros/src/macros/enum_map.rs b/strum_macros/src/macros/enum_map.rs index 0260055..23144d8 100644 --- a/strum_macros/src/macros/enum_map.rs +++ b/strum_macros/src/macros/enum_map.rs @@ -64,7 +64,7 @@ pub fn enum_map_inner(ast: &DeriveInput) -> syn::Result<TokenStream> { }; let pas...
1
1
1
e4ec66cfda0c61f19d5d003d5341e4b2abf5d502
PokeJofeJr4th
2023-06-28T21:41:09
used snakify from `enum_is`, used `format_ident` macro moved snakify into `helpers` mod
diff --git a/strum_macros/src/helpers/mod.rs b/strum_macros/src/helpers/mod.rs index 11aebc8..a685f49 100644 --- a/strum_macros/src/helpers/mod.rs +++ b/strum_macros/src/helpers/mod.rs @@ -7,6 +7,7 @@ mod metadata; pub mod type_props; pub mod variant_props; +use heck::ToSnakeCase; use proc_macro2::Span; use quote...
3
23
37
6a20524b4de60484fa41014997ad592a2beae904
PokeJofeJr4th
2023-06-28T17:57:54
Remove commented get and set Co-authored-by: June <61218022+itsjunetime@users.noreply.github.com>
diff --git a/strum_macros/src/macros/enum_map.rs b/strum_macros/src/macros/enum_map.rs index 725b1e2..c935642 100644 --- a/strum_macros/src/macros/enum_map.rs +++ b/strum_macros/src/macros/enum_map.rs @@ -150,18 +150,6 @@ pub fn enum_map_inner(ast: &DeriveInput) -> syn::Result<TokenStream> { } ...
1
0
12
510a160fb2697d2014774736355d847c202a0af9
PokeJofeJr4th
2023-06-25T18:16:11
implemented 2nd solution to #5 - panic when indexed
diff --git a/strum_macros/src/macros/enum_map.rs b/strum_macros/src/macros/enum_map.rs index a8af75b..725b1e2 100644 --- a/strum_macros/src/macros/enum_map.rs +++ b/strum_macros/src/macros/enum_map.rs @@ -8,7 +8,7 @@ pub fn enum_map_inner(ast: &DeriveInput) -> syn::Result<TokenStream> { let name = &ast.ident; ...
2
33
2
b66a61215709e80ed3a1f3dad93fc1995ca33dbc
PokeJofeJr4th
2023-06-25T15:26:56
updated documentation
diff --git a/strum_macros/src/lib.rs b/strum_macros/src/lib.rs index 5e5eb3b..bf688e8 100644 --- a/strum_macros/src/lib.rs +++ b/strum_macros/src/lib.rs @@ -411,48 +411,38 @@ pub fn enum_is(input: proc_macro::TokenStream) -> proc_macro::TokenStream { /// Creates a new type that maps all the variants of an enum to an...
1
19
29
7bd40a3687dddabd287fed12be0f32fae8806aa5
PokeJofeJr4th
2023-06-25T13:31:20
added `all` and `all_ok` for options and results
diff --git a/strum_macros/src/macros/enum_map.rs b/strum_macros/src/macros/enum_map.rs index 77496ea..a8af75b 100644 --- a/strum_macros/src/macros/enum_map.rs +++ b/strum_macros/src/macros/enum_map.rs @@ -43,7 +43,7 @@ pub fn enum_map_inner(ast: &DeriveInput) -> syn::Result<TokenStream> { if variant.get_varian...
2
66
1
8e7aa05d8fc71db75a4fcab95770438b7b1c53c7
PokeJofeJr4th
2023-06-25T12:11:17
added tests, fixed bad code from last commit
diff --git a/strum_macros/src/macros/enum_map.rs b/strum_macros/src/macros/enum_map.rs index a021289..e2d9403 100644 --- a/strum_macros/src/macros/enum_map.rs +++ b/strum_macros/src/macros/enum_map.rs @@ -52,7 +52,6 @@ pub fn enum_map_inner(ast: &DeriveInput) -> syn::Result<TokenStream> { }; let pas...
2
70
14
8e488b27d937dfc119fcb669eea7aac39e599294
pokejofejr4th@gmail.com
2023-06-24T17:54:14
added features #1, #2, #3
diff --git a/strum_macros/src/macros/enum_map.rs b/strum_macros/src/macros/enum_map.rs index 1f0e387..a021289 100644 --- a/strum_macros/src/macros/enum_map.rs +++ b/strum_macros/src/macros/enum_map.rs @@ -33,6 +33,10 @@ pub fn enum_map_inner(ast: &DeriveInput) -> syn::Result<TokenStream> { let mut get_matches_mut ...
1
24
0
0fc2a6bda5d9c9fa4812fb6ed9e5ef3f2bd81b13
PokeJofeJr4th
2023-06-24T01:54:46
Merged in some of June's code switched from array to struct
diff --git a/strum_macros/src/lib.rs b/strum_macros/src/lib.rs index 1b65f03..d0f0b81 100644 --- a/strum_macros/src/lib.rs +++ b/strum_macros/src/lib.rs @@ -394,7 +394,7 @@ pub fn enum_iter(input: proc_macro::TokenStream) -> proc_macro::TokenStream { /// ``` /// use strum_macros::{EnumIter, EnumMap}; /// -/// #[deri...
2
80
69
85e2c1692b150d5efad3d606db871dbddb320b86
Mendy Berger
2023-06-18T00:58:53
Added enum_is (#257) * Added enum_is * feat(is): Use a simple match and cover all cases * Removed dependency convert_case * Added disabled support for enum_is
diff --git a/strum_macros/src/lib.rs b/strum_macros/src/lib.rs index cc1c2a1..a37ccdc 100644 --- a/strum_macros/src/lib.rs +++ b/strum_macros/src/lib.rs @@ -384,6 +384,31 @@ pub fn enum_iter(input: proc_macro::TokenStream) -> proc_macro::TokenStream { toks.into() } +/// Generated `is_*()` methods for each varia...
4
157
0
e6a9bf08c4ca009ae46fde46efed59572bc9fd42
Josh McKinney
2023-06-18T00:58:12
fix!: use the tuple value for to_string on default (#270) The default attribute on a tuple like variant now causes the to_string and display format to use the value of the tuple rather than the name of the variant. E.g. Color::Green("lime").to_string() will equal "lime" not "Green" Fixes: how to round trip Dis...
diff --git a/strum_macros/src/helpers/variant_props.rs b/strum_macros/src/helpers/variant_props.rs index a39d3ea..f637253 100644 --- a/strum_macros/src/helpers/variant_props.rs +++ b/strum_macros/src/helpers/variant_props.rs @@ -19,7 +19,7 @@ pub struct StrumVariantProperties { pub documentation: Vec<LitStr>, ...
5
84
2
2b71e101201c20e95eccd528b9123096ca6b6640
CosmicHorror
2023-06-18T00:57:26
Update syn to v2 (#261)
diff --git a/strum_macros/Cargo.toml b/strum_macros/Cargo.toml index bdb1c3c..60e5b57 100644 --- a/strum_macros/Cargo.toml +++ b/strum_macros/Cargo.toml @@ -23,7 +23,7 @@ heck = "0.4.1" proc-macro2 = "1.0" quote = "1.0" rustversion = "1.0" -syn = { version = "1.0", features = ["parsing", "extra-traits"] } +syn = { v...
5
35
61
67f0d1947d6860d33519f71c714a6e57e0f6f971
Matt Schulte
2023-06-18T00:50:15
Fix EnumCount with disabled variants (#268) Do not include disabled variants in the count with EnumCount. Fixes #267
diff --git a/strum_macros/src/macros/enum_count.rs b/strum_macros/src/macros/enum_count.rs index 44c7f2e..b9e6aaa 100644 --- a/strum_macros/src/macros/enum_count.rs +++ b/strum_macros/src/macros/enum_count.rs @@ -2,11 +2,18 @@ use proc_macro2::TokenStream; use quote::quote; use syn::{Data, DeriveInput}; +use crate:...
2
25
1
16225b6f4771f184a1a9f003f734547bd9a955ac
PokeJofeJr4th
2023-05-19T01:57:42
added enum map macro and lib.rs test need to make error detection (dependency on EnumIter, etc.) more robust
diff --git a/strum_macros/src/lib.rs b/strum_macros/src/lib.rs index cc1c2a1..1b65f03 100644 --- a/strum_macros/src/lib.rs +++ b/strum_macros/src/lib.rs @@ -384,6 +384,52 @@ pub fn enum_iter(input: proc_macro::TokenStream) -> proc_macro::TokenStream { toks.into() } +/// Creates a new type that maps all the vari...
3
165
0
30c5c16515073a65b5e5a416721ba0bdf397dd42
Rory Snively
2023-05-06T21:55:43
fix deprecation warning in additional_attributes example (#264)
diff --git a/strum/src/additional_attributes.rs b/strum/src/additional_attributes.rs index a7ae756..a29f1d6 100644 --- a/strum/src/additional_attributes.rs +++ b/strum/src/additional_attributes.rs @@ -20,11 +20,9 @@ //! - `Train-Case` //! //! ```rust -//! use std::string::ToString; -//! use strum; //! use...
1
1
3
635ab9511ba8464deacf43a026b0b94383ef5b68
Martin Kauppinen
2023-03-12T21:48:07
Add Train-Case case style (#256)
diff --git a/strum/src/additional_attributes.rs b/strum/src/additional_attributes.rs index 5e32914..a7ae756 100644 --- a/strum/src/additional_attributes.rs +++ b/strum/src/additional_attributes.rs @@ -17,6 +17,7 @@ //! - `UPPERCASE` //! - `title_case` //! - `mixed_case` +//! - `Train-Case` //! //! ```rus...
3
8
2
405832679ffdbb8edff369a7487e356faafac718
Kesavan Yogeswaran
2023-02-26T19:08:58
Fix doc comment for strum::EnumIter macro (#253) The `EnumIter` macro's doc comment has a typo around the implemented trait. The implemented trait is `strum::IntoEnumIterator`.
diff --git a/strum_macros/src/lib.rs b/strum_macros/src/lib.rs index f184a12..cc1c2a1 100644 --- a/strum_macros/src/lib.rs +++ b/strum_macros/src/lib.rs @@ -344,7 +344,7 @@ pub fn display(input: proc_macro::TokenStream) -> proc_macro::TokenStream { /// Creates a new type that iterates of the variants of an enum. /// ...
1
1
1
2d47a853ffe0d7b7c972eece5a257e9f913fc88a
Eric McBride
2023-02-26T17:53:34
add occurence errros
diff --git a/strum_macros/src/helpers/inner_variant_props.rs b/strum_macros/src/helpers/inner_variant_props.rs index 92ceab4..bc0fe79 100644 --- a/strum_macros/src/helpers/inner_variant_props.rs +++ b/strum_macros/src/helpers/inner_variant_props.rs @@ -1,4 +1,5 @@ use super::metadata::{InnerVariantExt, InnerVariantMet...
1
7
1
453b76a0859866bd8fd7bb1950d4d411a2e96da3
Eric McBride
2023-02-26T16:51:03
remove uneeded comment
diff --git a/strum_macros/src/helpers/inner_variant_props.rs b/strum_macros/src/helpers/inner_variant_props.rs index 408a2b6..92ceab4 100644 --- a/strum_macros/src/helpers/inner_variant_props.rs +++ b/strum_macros/src/helpers/inner_variant_props.rs @@ -8,7 +8,6 @@ pub trait HasInnerVariantProperties { #[derive(Clone, ...
1
0
1
dbe61933a94b68fb36e88213e6df840388c13602
Eric McBride
2023-02-26T16:43:34
Initial Push
diff --git a/strum_macros/src/helpers/inner_variant_props.rs b/strum_macros/src/helpers/inner_variant_props.rs new file mode 100644 index 0000000..408a2b6 --- /dev/null +++ b/strum_macros/src/helpers/inner_variant_props.rs @@ -0,0 +1,28 @@ +use super::metadata::{InnerVariantExt, InnerVariantMeta}; +use syn::{Field, Lit...
7
189
23
7efb86efbece548129256aaca6a3f23ac43be3a3
Alex
2023-01-03T00:00:42
Change `kebab_case` to `kebab-case` in example (#248)
diff --git a/strum_macros/src/lib.rs b/strum_macros/src/lib.rs index 413f9fd..f184a12 100644 --- a/strum_macros/src/lib.rs +++ b/strum_macros/src/lib.rs @@ -175,7 +175,7 @@ pub fn as_ref_str(input: proc_macro::TokenStream) -> proc_macro::TokenStream { /// use strum::VariantNames; /// /// #[derive(Debug, EnumString, ...
1
1
1
e772e203dabd58630730c1520a2e2110eaf13fc2
Peter Glotfelty
2022-10-15T19:00:20
implement Debug for EnumIter (#240) Co-authored-by: Peter Glotfelty <peter@glotfelty.us>
diff --git a/strum_macros/src/macros/enum_iter.rs b/strum_macros/src/macros/enum_iter.rs index 203b926..d136d30 100644 --- a/strum_macros/src/macros/enum_iter.rs +++ b/strum_macros/src/macros/enum_iter.rs @@ -65,11 +65,14 @@ pub fn enum_iter_inner(ast: &DeriveInput) -> syn::Result<TokenStream> { arms.push(quote! {...
1
14
1
dd0c2fa785377172cafea91f2bed3b70cb083a78
Mike Leany
2022-10-15T18:59:55
Fix doc comment for EnumIter (#242) Comment now says that it iterates over variants of the enum rather than variants of `Self`, which would be the iterator.
diff --git a/strum_macros/src/macros/enum_iter.rs b/strum_macros/src/macros/enum_iter.rs index 9c7017c..203b926 100644 --- a/strum_macros/src/macros/enum_iter.rs +++ b/strum_macros/src/macros/enum_iter.rs @@ -11,6 +11,7 @@ pub fn enum_iter_inner(ast: &DeriveInput) -> syn::Result<TokenStream> { let vis = &ast.vis; ...
1
2
1
93d0886377818ac655c3e35d2f256094156dc947
Alissa Tung
2022-09-25T19:10:49
chore: fix typo (#239) * chore: fix typo * chore: fix typo
diff --git a/strum/src/lib.rs b/strum/src/lib.rs index 2711912..a9e8444 100644 --- a/strum/src/lib.rs +++ b/strum/src/lib.rs @@ -7,7 +7,7 @@ //! Strum is a set of macros and traits for working with //! enums and strings easier in Rust. //! -//! The full version of the README can be found on [Github](https://github.c...
2
2
2
54771c0870aac4e197009d567b4fc0a236155dc9
Tim Siegel
2022-09-19T17:31:34
strum_macros::FromRepr: fix typo in documentation (#236)
diff --git a/strum_macros/src/lib.rs b/strum_macros/src/lib.rs index de16c9c..aff7837 100644 --- a/strum_macros/src/lib.rs +++ b/strum_macros/src/lib.rs @@ -390,7 +390,7 @@ pub fn enum_iter(input: proc_macro::TokenStream) -> proc_macro::TokenStream { /// `from_repr(discriminant: usize) -> Option<YourEnum>` as a standa...
1
1
1
d8278db86638702d4341fb4ea7356dd1abe92911
Peter Glotfelty
2022-08-07T23:32:28
add allows to prevent lint errors (#231) Co-authored-by: Peter Glotfelty <peter@glotfelty.us>
diff --git a/strum_macros/src/macros/enum_iter.rs b/strum_macros/src/macros/enum_iter.rs index 2e61137..9c7017c 100644 --- a/strum_macros/src/macros/enum_iter.rs +++ b/strum_macros/src/macros/enum_iter.rs @@ -66,6 +66,10 @@ pub fn enum_iter_inner(ast: &DeriveInput) -> syn::Result<TokenStream> { Ok(quote! { ...
1
4
0
b5ba7cc12c0dd1b0614cabb119e7814c76cf645a
Peter Glotfelty
2022-06-25T00:47:32
Revert "Add TryFrom to FromRepr (#217)" (#228) This reverts commit ac757fa9702cacd4559c444b309c27b97fa1de59.
diff --git a/strum_macros/src/lib.rs b/strum_macros/src/lib.rs index ae368e0..de16c9c 100644 --- a/strum_macros/src/lib.rs +++ b/strum_macros/src/lib.rs @@ -384,8 +384,7 @@ pub fn enum_iter(input: proc_macro::TokenStream) -> proc_macro::TokenStream { toks.into() } -/// Add a function to enum that allows accessi...
4
12
81
a952fc0028d994b7481100cf37f8543e74ff2cec
Peter Glotfelty
2022-05-17T04:33:33
Peternator7/update phf logic (#224) * Support phf crate for faster match on large enums * comment * add changelog entry * add tests, embed phf, and improve lowercase support * fix doc change * Refactor & support case insensitive with case sensitive phf match * more tests, some fixes of new implementa...
diff --git a/strum_macros/src/macros/strings/from_string.rs b/strum_macros/src/macros/strings/from_string.rs index a4cc4d1..2d25591 100644 --- a/strum_macros/src/macros/strings/from_string.rs +++ b/strum_macros/src/macros/strings/from_string.rs @@ -20,12 +20,8 @@ pub fn from_string_inner(ast: &DeriveInput) -> syn::Resu...
1
15
46
ac757fa9702cacd4559c444b309c27b97fa1de59
Daniil Gentili
2022-04-30T18:24:17
Add TryFrom to FromRepr (#217) * Add TryFrom to FromRepr * Fix building on rust < 1.34
diff --git a/strum_macros/src/lib.rs b/strum_macros/src/lib.rs index 32f9a78..a6ff225 100644 --- a/strum_macros/src/lib.rs +++ b/strum_macros/src/lib.rs @@ -381,7 +381,8 @@ pub fn enum_iter(input: proc_macro::TokenStream) -> proc_macro::TokenStream { toks.into() } -/// Add a function to enum that allows accessi...
4
81
12
054df849e19fb686d9c4c42366bc8baa99f41d48
Peter Glotfelty
2022-04-16T19:28:10
Fix unit tests
diff --git a/strum_macros/Cargo.toml b/strum_macros/Cargo.toml index 8dff380..5dfd370 100644 --- a/strum_macros/Cargo.toml +++ b/strum_macros/Cargo.toml @@ -26,4 +26,4 @@ rustversion = "1.0" syn = { version = "1.0", features = ["parsing", "extra-traits"] } [dev-dependencies] -strum = "0.23" +strum = "0.24" diff --g...
2
2
2
9465cd5dbbdc38c3f2fa5edf4aeeed66f813038c
Spenser Black
2022-03-14T16:22:19
Use full path for `None` in `EnumIter` (#214)
diff --git a/strum_macros/src/macros/enum_iter.rs b/strum_macros/src/macros/enum_iter.rs index 3dc2abd..2e61137 100644 --- a/strum_macros/src/macros/enum_iter.rs +++ b/strum_macros/src/macros/enum_iter.rs @@ -110,7 +110,7 @@ pub fn enum_iter_inner(ast: &DeriveInput) -> syn::Result<TokenStream> { //...
1
2
2
94460f006cc6ecce6fe77262a073372d283ad0fe
Peter Glotfelty
2022-02-21T22:20:01
Revert a small change from get_docs
diff --git a/strum_macros/Cargo.toml b/strum_macros/Cargo.toml index 6c57728..8dff380 100644 --- a/strum_macros/Cargo.toml +++ b/strum_macros/Cargo.toml @@ -26,4 +26,4 @@ rustversion = "1.0" syn = { version = "1.0", features = ["parsing", "extra-traits"] } [dev-dependencies] -strum = { path = "../strum" } +strum = ...
1
1
1
e558e913f4c48ab91434a73b28e82508646d1a3b
Oren Ben-Kiki
2022-02-21T21:37:25
Add get_documentation() to EnumMessage. (#206) * Add get_documentation() to EnumMessage. * Address 1st review comments. * Remove usage of strip_prefix to support older Rust versions. Co-authored-by: Peter Glotfelty <glotfelty.2@osu.edu>
diff --git a/strum/src/additional_attributes.rs b/strum/src/additional_attributes.rs index 0cb844d..5e32914 100644 --- a/strum/src/additional_attributes.rs +++ b/strum/src/additional_attributes.rs @@ -88,4 +88,6 @@ //! - `detailed_message=".."`: Adds a more detailed message to a variant. If this value is omitted, then...
8
95
6
c676655d1127b3177e4ce1351fc99815c37fa2e6
matt rice
2022-02-05T23:29:26
use core instead of std in a couple places. (#209)
diff --git a/strum_macros/src/macros/enum_iter.rs b/strum_macros/src/macros/enum_iter.rs index 85bdaf3..6df14d9 100644 --- a/strum_macros/src/macros/enum_iter.rs +++ b/strum_macros/src/macros/enum_iter.rs @@ -45,7 +45,7 @@ pub fn enum_iter_inner(ast: &DeriveInput) -> syn::Result<TokenStream> { let params = mat...
2
2
2
260322fb7eee8e4bd97c15e5cbc6d1dd18645c8a
daxpedda
2022-02-05T23:28:57
Add `allow(clippy::use_self)` to remove warnings from `FromRepr` (#211)
diff --git a/strum_macros/src/macros/from_repr.rs b/strum_macros/src/macros/from_repr.rs index e3f2ac6..dc7166e 100644 --- a/strum_macros/src/macros/from_repr.rs +++ b/strum_macros/src/macros/from_repr.rs @@ -127,6 +127,7 @@ pub fn from_repr_inner(ast: &DeriveInput) -> syn::Result<TokenStream> { }; Ok(quote...
1
1
0
fb88d04dcfb2eb2ba63c4f6dd924afed96d5b2f7
Alex Gaynor
2022-01-15T20:40:14
Update to heck 0.4 (#201)
diff --git a/strum_macros/Cargo.toml b/strum_macros/Cargo.toml index 140f2e9..5fa4df2 100644 --- a/strum_macros/Cargo.toml +++ b/strum_macros/Cargo.toml @@ -19,7 +19,7 @@ proc-macro = true name = "strum_macros" [dependencies] -heck = "0.3" +heck = "0.4" proc-macro2 = "1.0" quote = "1.0" rustversion = "1.0" diff ...
3
8
6
b855edb46364b74d25c694d68acc209be0b34a4c
Peter Glotfelty
2022-01-14T14:54:03
Peternator7/enum iter doc comment (#204)
diff --git a/strum_macros/src/macros/enum_iter.rs b/strum_macros/src/macros/enum_iter.rs index 515160c..85bdaf3 100644 --- a/strum_macros/src/macros/enum_iter.rs +++ b/strum_macros/src/macros/enum_iter.rs @@ -67,7 +67,7 @@ pub fn enum_iter_inner(ast: &DeriveInput) -> syn::Result<TokenStream> { let iter_name = syn:...
1
1
1
837c785a881477a88b2755641e1acfc6322ec89c
Peter Glotfelty
2022-01-09T17:37:17
Pin clap version (#205) Co-authored-by: Peter Glotfelty <peter@glotfelty.us>
diff --git a/strum_tests/Cargo.toml b/strum_tests/Cargo.toml index 9105172..05a6493 100644 --- a/strum_tests/Cargo.toml +++ b/strum_tests/Cargo.toml @@ -7,7 +7,7 @@ authors = ["Peter Glotfelty <peglotfe@microsoft.com>"] [dependencies] strum = { path = "../strum", features = ["derive"] } strum_macros = { path = "../s...
1
1
1
ced17d4c5855f2915ed36a7ad666fe0aea612467
LJ
2022-01-08T20:08:45
Add doc comment to FromRepr macro (#202) This will help people who have missing_docs denied.
diff --git a/strum_macros/src/macros/from_repr.rs b/strum_macros/src/macros/from_repr.rs index 7fdb1b5..f93bd99 100644 --- a/strum_macros/src/macros/from_repr.rs +++ b/strum_macros/src/macros/from_repr.rs @@ -128,6 +128,7 @@ pub fn from_repr_inner(ast: &DeriveInput) -> syn::Result<TokenStream> { Ok(quote! { ...
1
1
0
0c80602333a1fb462034fae1562b8d4e71fbe717
Peter Glotfelty
2021-11-20T19:30:11
Add tests for nostd environment (#196) Co-authored-by: Peter Glotfelty <peter@glotfelty.us>
diff --git a/Cargo.toml b/Cargo.toml index 619d955..094b6e6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ members = [ "strum", "strum_macros", - "strum_tests" + "strum_tests", + "strum_nostd_tests" ] - -exclude = [ "strum_tests_rename" ] \ No newline at end of file + \ No newline at end...
4
54
4
2ba6b0a9c3fd80c08854ba8ddebce530e9b430f8
Peter Glotfelty
2021-11-20T02:31:08
Run rustfmt over the whole tree (#195) Co-authored-by: Peter Glotfelty <peter@glotfelty.us>
diff --git a/strum/src/additional_attributes.rs b/strum/src/additional_attributes.rs index a93f827..399ca32 100644 --- a/strum/src/additional_attributes.rs +++ b/strum/src/additional_attributes.rs @@ -1,12 +1,12 @@ //! # Documentation for Additional Attributes -//! +//! //! ## Attributes on Enums //! //! Strum sup...
5
26
21
1e3acb64a7a08b35b23150cd793bb54ee444e255
Tyler Hall
2021-11-19T20:12:59
Disambiguate associated items in trait impls (#193) The addition of TryFrom<&str> for EnumString breaks for enums that have a variant called "Error". Rewrite as <Self as Trait> where associated types are used as the return type for trait functions. Example: ```rust pub enum Test { Error, } ``` error...
diff --git a/strum_macros/src/macros/enum_iter.rs b/strum_macros/src/macros/enum_iter.rs index a006d85..515160c 100644 --- a/strum_macros/src/macros/enum_iter.rs +++ b/strum_macros/src/macros/enum_iter.rs @@ -96,7 +96,7 @@ pub fn enum_iter_inner(ast: &DeriveInput) -> syn::Result<TokenStream> { impl #impl_gener...
2
5
5
5c0ee93860e4a1f2ec3739699256ef09e5c038d0
Danny Milosavljevic
2021-11-18T19:11:02
Use core::* instead of std::* in order to make it work in a no_std environment. (#192) Co-authored-by: Danny Milosavljevic <daym@oxidecomputer.com>
diff --git a/strum_macros/src/macros/strings/from_string.rs b/strum_macros/src/macros/strings/from_string.rs index 879dd87..8a6c40f 100644 --- a/strum_macros/src/macros/strings/from_string.rs +++ b/strum_macros/src/macros/strings/from_string.rs @@ -134,10 +134,10 @@ fn try_from_str( ) -> TokenStream { quote! { ...
1
3
3
c8cd49f4e3035da57b79d26804f8aa1be8cf302e
Peter Glotfelty
2021-11-17T05:56:51
Use rustversion instead of version_check in strum_tests
diff --git a/strum_tests/Cargo.toml b/strum_tests/Cargo.toml index 28664a2..9105172 100644 --- a/strum_tests/Cargo.toml +++ b/strum_tests/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "strum_tests" -version = "0.22.0" +version = "0.23.0" edition = "2018" authors = ["Peter Glotfelty <peglotfe@microsoft.com>"] @@ -12...
3
6
16
aeaa19ad861fb5a2cb5d7050ef10838a649b1266
Andrew Burkett
2021-11-06T16:30:09
EnumIndex implementation (#185) * Add EnumConstIndex * Get working with discriminants * Remove unused/(unneeded?) features * Rename to EnumIndex and index(..). Make const_index conditional * Get repr(..) working * Fix issue to support rust 1.32 * Switch from VARIANT# to {ENUM}_{VARIANT} for variant c...
diff --git a/strum/src/lib.rs b/strum/src/lib.rs index 9f7b9de..fe12b92 100644 --- a/strum/src/lib.rs +++ b/strum/src/lib.rs @@ -217,6 +217,7 @@ DocumentMacroRexports! { EnumProperty, EnumString, EnumVariantNames, + FromRepr, IntoStaticStr, ToString } diff --git a/strum_macros/src/lib.rs b/...
5
285
0
1a703a4103ff538126c73b14b10cdb8ea75d02c5
Danny Milosavljevic
2021-10-26T19:17:54
Use core::result instead of std::result in order to make it work in a no_std environment. (#189) Co-authored-by: Danny Milosavljevic <daym@oxidecomputer.com>
diff --git a/strum_macros/src/macros/strings/from_string.rs b/strum_macros/src/macros/strings/from_string.rs index a42ff4d..879dd87 100644 --- a/strum_macros/src/macros/strings/from_string.rs +++ b/strum_macros/src/macros/strings/from_string.rs @@ -19,7 +19,7 @@ pub fn from_string_inner(ast: &DeriveInput) -> syn::Resul...
1
5
5
7b68e4dc4430401c574a0b6a84b2bc2c7996f9d4
Dominik Spicher
2021-10-26T19:16:57
Add TryFrom<&str> to EnumString (#186) The implementation simply delegates to `std::str::FromStr`. To maintain compatibility with Rust 1.32, a new dependency is introduced which allows us to emit the `TryFrom<&str>` implementation only for Rust 1.34 and above when `std::convert::TryFrom` was stabilized.
diff --git a/strum_macros/Cargo.toml b/strum_macros/Cargo.toml index ee84210..fcf643c 100644 --- a/strum_macros/Cargo.toml +++ b/strum_macros/Cargo.toml @@ -22,6 +22,7 @@ name = "strum_macros" heck = "0.3" proc-macro2 = "1.0" quote = "1.0" +rustversion = "1.0" syn = { version = "1.0", features = ["parsing", "extra-...
5
105
51
1ec35285a075f294da1446e0526a7ab997966ff8
Peter Glotfelty
2021-10-10T19:45:19
Update documentation to include listing all the supported case styles. (#182) Co-authored-by: Peter Glotfelty <peter@glotfelty.us>
diff --git a/strum/src/additional_attributes.rs b/strum/src/additional_attributes.rs index 8172a90..a93f827 100644 --- a/strum/src/additional_attributes.rs +++ b/strum/src/additional_attributes.rs @@ -1,41 +1,57 @@ //! # Documentation for Additional Attributes +//! +//! ## Attributes on Enums //! -//! Strum supports...
1
51
35
6119f107e2513fb3602efece127884c874463968
Jonathan Chan Kwan Yin
2021-10-08T04:43:49
Fixed incorrectly commented `deprecated` attribute (#178) * Fixed incorrectly commented `deprecated` attribute * Also deprecate the `AsStaticRef` macro. * Changed deprecation version to 0.22.0
diff --git a/strum/src/lib.rs b/strum/src/lib.rs index ed50ea7..18a8af7 100644 --- a/strum/src/lib.rs +++ b/strum/src/lib.rs @@ -168,7 +168,7 @@ pub trait EnumProperty { /// A cheap reference-to-reference conversion. Used to convert a value to a /// reference value with `'static` lifetime within generic code. -/// ...
2
2
1