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 |
|---|---|---|---|---|---|---|---|
75519edcffe18b8d9b4c144fdbb7e628c5cc3669 | Peter Glotfelty | 2021-10-02T15:30:03 | pin bitflags version in tests project to fix builds | diff --git a/strum_tests/Cargo.toml b/strum_tests/Cargo.toml
index a8b6637..8c53306 100644
--- a/strum_tests/Cargo.toml
+++ b/strum_tests/Cargo.toml
@@ -10,6 +10,7 @@ strum_macros = { path = "../strum_macros", features = [] }
clap = "2.33.0"
enum_variant_type = "=0.2.0"
structopt = "0.2.18"
+bitflags = "=1.2"
[bu... | 1 | 1 | 0 |
db5071874b38b785082a3e5e25f77d86246c3c22 | Cor Peters | 2021-08-04T04:19:21 | Features/no std (#171)
* Added std feature to allow for no_std usage
* added no_std attr
Co-authored-by: Luctius <luctius@gmail.com> | diff --git a/strum/Cargo.toml b/strum/Cargo.toml
index b730a44..d4225b5 100644
--- a/strum/Cargo.toml
+++ b/strum/Cargo.toml
@@ -24,7 +24,9 @@ strum_macros = { path = "../strum_macros", version = "0.21" }
travis-ci = { repository = "Peternator7/strum" }
[features]
+default = ["std"]
derive = ["strum_macros"]
+std ... | 2 | 7 | 0 |
e9d3b59a80adbd8e7ebf88bf5b63badbcb595799 | Billy Chan | 2021-07-17T03:40:19 | Re-export macros (#170)
* Re-exportable macros
* Rename derive attribute to `Crate`
* Add unit tests
* Test nested module
* Rename derive attribute to `crate`
* cargo fmt | diff --git a/strum_macros/src/helpers/metadata.rs b/strum_macros/src/helpers/metadata.rs
index bee07d2..6279e6a 100644
--- a/strum_macros/src/helpers/metadata.rs
+++ b/strum_macros/src/helpers/metadata.rs
@@ -2,6 +2,7 @@ use proc_macro2::{Span, TokenStream};
use syn::{
parenthesized,
parse::{Parse, ParseStre... | 15 | 215 | 12 |
dcd8df14bf0e90cb3ccd8d28fe3395f4ec37085e | Matt W | 2021-06-02T01:34:42 | fix for field not method complaint in strum_macro's metadata.rs (#164) | diff --git a/strum_macros/src/helpers/metadata.rs b/strum_macros/src/helpers/metadata.rs
index 3c676cb..bee07d2 100644
--- a/strum_macros/src/helpers/metadata.rs
+++ b/strum_macros/src/helpers/metadata.rs
@@ -194,7 +194,7 @@ impl Parse for VariantMeta {
let kw = input.parse()?;
let value = if ... | 1 | 1 | 1 |
81df48a15f4d9dcb4b0fd386340c34ba325e8dd8 | Franz Dietrich | 2021-05-26T17:06:22 | Add allow(use_self) to remove warnings. (#161) | diff --git a/strum_macros/src/macros/strings/from_string.rs b/strum_macros/src/macros/strings/from_string.rs
index bf17d8e..0ca6b9b 100644
--- a/strum_macros/src/macros/strings/from_string.rs
+++ b/strum_macros/src/macros/strings/from_string.rs
@@ -87,6 +87,7 @@ pub fn from_string_inner(ast: &DeriveInput) -> syn::Resul... | 2 | 2 | 0 |
3869b6fa907b1dae96f224ce12e91d3531c5621b | Ian Jackson | 2021-05-18T22:52:33 | enum messages: Make the returned values all 'static (#160)
This is (at least in theory) a breaking change, because someone might
have implemented this trait by hand, and their implementation won't
be declared as returning 'static lifetimes.
Closes #159
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.u... | diff --git a/strum/src/lib.rs b/strum/src/lib.rs
index 755da75..ef273e2 100644
--- a/strum/src/lib.rs
+++ b/strum/src/lib.rs
@@ -118,9 +118,9 @@ pub trait IntoEnumIterator: Sized {
/// assert_eq!("I have a dog", my_pet.get_message().unwrap());
/// ```
pub trait EnumMessage {
- fn get_message(&self) -> Option<&str... | 3 | 9 | 9 |
f71830c5fedd1ed1228988ab056b600d3cf2595b | Peter Glotfelty | 2021-05-15T07:28:52 | Pin exact version of enum_variant_type (#162) | diff --git a/strum_tests/Cargo.toml b/strum_tests/Cargo.toml
index d80b09e..defd2f0 100644
--- a/strum_tests/Cargo.toml
+++ b/strum_tests/Cargo.toml
@@ -8,7 +8,7 @@ authors = ["Peter Glotfelty <peglotfe@microsoft.com>"]
strum = { path = "../strum", features = ["derive"] }
strum_macros = { path = "../strum_macros", fe... | 1 | 1 | 1 |
ca60910df050e1c2299d5ea71121dc6d7b0489e8 | Chayim Refael Friedman | 2021-05-03T03:59:48 | Support case-insensitive `EnumString` (#157)
Fixes #154 | diff --git a/strum/src/additional_attributes.rs b/strum/src/additional_attributes.rs
index 0b32a25..e3d86eb 100644
--- a/strum/src/additional_attributes.rs
+++ b/strum/src/additional_attributes.rs
@@ -34,6 +34,9 @@
//! );
//! ```
//!
+//! You can also apply the `#[strum(ascii_case_insensitive)]` attribute to the enu... | 7 | 127 | 8 |
089aec83035cfff4151459ebf2eb549ee465299f | Vlad Frolov | 2021-03-19T17:45:55 | Added a pass-through attribute support to EnumDiscriminants (#153)
* Added a pass-through attribute support to EnumDiscriminants
* added a test per review comment | diff --git a/strum_macros/src/helpers/mod.rs b/strum_macros/src/helpers/mod.rs
index 77049eb..30787b2 100644
--- a/strum_macros/src/helpers/mod.rs
+++ b/strum_macros/src/helpers/mod.rs
@@ -9,11 +9,19 @@ pub mod variant_props;
use proc_macro2::Span;
use quote::ToTokens;
+use syn::spanned::Spanned;
pub fn non_enum... | 4 | 83 | 14 |
d0977780d88353c7b1d829c6f69fe0323a57a3d3 | Peter Glotfelty | 2021-03-06T19:46:13 | Remove the "rename" feature (#149) | diff --git a/strum_macros/Cargo.toml b/strum_macros/Cargo.toml
index 5eb2308..fb9e72c 100644
--- a/strum_macros/Cargo.toml
+++ b/strum_macros/Cargo.toml
@@ -26,17 +26,3 @@ syn = { version = "1.0", features = ["parsing", "extra-traits"] }
[dev-dependencies]
strum = "0.20"
-
-[features]
-verbose-enumstring-name = []
... | 6 | 15 | 165 |
39e76b630fc7af67a5b96b781d917f33cb0964c1 | Laurence Tratt | 2021-02-21T20:57:31 | Document the existence of the auto-From implementations (#151)
* Tweak wording.
* Reformat.
* Document the existence of the auto-From implementation. | diff --git a/strum_macros/src/lib.rs b/strum_macros/src/lib.rs
index 444794b..2c94a21 100644
--- a/strum_macros/src/lib.rs
+++ b/strum_macros/src/lib.rs
@@ -562,11 +562,15 @@ pub fn enum_properties(input: proc_macro::TokenStream) -> proc_macro::TokenStrea
/// Generate a new type with only the discriminant names.
//... | 1 | 20 | 5 |
684f119dab976b8e96079262d4e6c7f087fab86e | Rudi Benkovič | 2021-02-06T16:28:50 | Replaced ::std with ::core where applicable. (#145)
This makes these macros usable with `no_std` projects. | diff --git a/strum_macros/src/macros/enum_discriminants.rs b/strum_macros/src/macros/enum_discriminants.rs
index 1aac79e..129c142 100644
--- a/strum_macros/src/macros/enum_discriminants.rs
+++ b/strum_macros/src/macros/enum_discriminants.rs
@@ -99,7 +99,7 @@ pub fn enum_discriminants_inner(ast: &DeriveInput) -> syn::Re... | 6 | 25 | 25 |
e56136f73ce03d2ffcb2908f0f2a1107aa7555fd | Mark LeMoine | 2020-11-23T21:49:54 | Adding support for doc comments on `EnumDiscriminants` generated type (#140) | diff --git a/strum_macros/src/helpers/metadata.rs b/strum_macros/src/helpers/metadata.rs
index e8b3558..15760ee 100644
--- a/strum_macros/src/helpers/metadata.rs
+++ b/strum_macros/src/helpers/metadata.rs
@@ -19,6 +19,7 @@ pub mod kw {
custom_keyword!(derive);
custom_keyword!(name);
custom_keyword!(vis);... | 3 | 24 | 2 |
ddb9c2682e93e831bd3e727fbf3611f2f2046ace | Mark LeMoine | 2020-11-16T04:13:50 | Adding visibility option `vis(...)` to `#[strum_discriminants]` (#137) (#138)
* Adding vis to EnumDiscriminants (#137)
* Improved doctest example names (#137)
* Fixing incorrect occurrence_error attr string
* Using r#pub on doctest
* Adding tests for discriminant visibility, and rustc-cfg for bare "pub"
... | diff --git a/strum_macros/src/helpers/metadata.rs b/strum_macros/src/helpers/metadata.rs
index cd36f60..e8b3558 100644
--- a/strum_macros/src/helpers/metadata.rs
+++ b/strum_macros/src/helpers/metadata.rs
@@ -4,7 +4,7 @@ use syn::{
parse::{Parse, ParseStream},
punctuated::Punctuated,
spanned::Spanned,
- ... | 6 | 95 | 4 |
90047fee861ad9a966af4ab06c33ee49f71cb424 | Jonas Platte | 2020-10-19T16:56:49 | Replace macro panics with syn::Error (#135) | diff --git a/strum_macros/src/helpers/metadata.rs b/strum_macros/src/helpers/metadata.rs
index cbf0628..cd36f60 100644
--- a/strum_macros/src/helpers/metadata.rs
+++ b/strum_macros/src/helpers/metadata.rs
@@ -9,7 +9,7 @@ use syn::{
use super::case_style::CaseStyle;
-mod kw {
+pub mod kw {
use syn::custom_keyw... | 15 | 137 | 94 |
25eaa5a12c4b8a2530fef0c630ff45f2c00951bd | Jonas Platte | 2020-10-15T16:27:38 | More attribute refactoring (#134)
* Remove unused method NestedMetaHelpers::expect_lit
* Use references match instead of ref patterns
* Use custom meta types instead of syn::Meta
This should improve both readability of the code and the quality of
error messages.
* Replace TryFrom<&str> with FromStr
* R... | diff --git a/strum/src/lib.rs b/strum/src/lib.rs
index 7d7964f..f89bb0b 100644
--- a/strum/src/lib.rs
+++ b/strum/src/lib.rs
@@ -201,7 +201,7 @@ macro_rules! DocumentMacroRexports {
// for docsrs. You can do a weird thing where you rename the macro
// and then reference it through strum. The renaming feature should b... | 19 | 393 | 318 |
4ad39923d0472d7413d399486e1303a57a534146 | Jonas Platte | 2020-10-08T05:18:30 | Refactor (#133)
* Remove unnecessary main in doctest
* Use syn::parse_macro_input!
* Add spans to attribute parse errors
* Add spans to more attribute errors
* Fix indentation
* Consistently import syn AST types | diff --git a/strum_macros/src/helpers/case_style.rs b/strum_macros/src/helpers/case_style.rs
index ca9c0e2..6295a77 100644
--- a/strum_macros/src/helpers/case_style.rs
+++ b/strum_macros/src/helpers/case_style.rs
@@ -1,4 +1,5 @@
use heck::{CamelCase, KebabCase, MixedCase, ShoutySnakeCase, SnakeCase, TitleCase};
+use s... | 16 | 247 | 209 |
89b9c14731b11422175701db80974328a2d24471 | Michael Kefeder | 2020-10-06T17:17:06 | Wiki to doc tests (#121)
* example usage as doctests added to the strum_macros crate
* removed links to to wiki example code and documentation of the macros
* added attribute documentation as a module in strum and linked to it | diff --git a/strum/src/additional_attributes.rs b/strum/src/additional_attributes.rs
new file mode 100644
index 0000000..0b32a25
--- /dev/null
+++ b/strum/src/additional_attributes.rs
@@ -0,0 +1,68 @@
+//! # Documentation for Additional Attributes
+//!
+//! Strum supports several custom attributes to modify the generat... | 4 | 504 | 31 |
7e64a470b1f07f44cbc30ab4a349b16975ad14ef | Jonas Platte | 2020-09-29T17:01:29 | Raise an error un malformed strum attributes (#119) | diff --git a/strum_macros/src/helpers/has_metadata.rs b/strum_macros/src/helpers/has_metadata.rs
index 9a57374..657d0e5 100644
--- a/strum_macros/src/helpers/has_metadata.rs
+++ b/strum_macros/src/helpers/has_metadata.rs
@@ -11,7 +11,8 @@ fn get_metadata_inner<'a>(
it: impl IntoIterator<Item = &'a syn::Attribute>,... | 1 | 2 | 1 |
06bbb62624019698f0165ef637f013533ed57d9c | Peter Glotfelty 🚀 | 2020-08-06T00:09:12 | ran cargo fmt over the whole tree | diff --git a/strum_macros/src/helpers/mod.rs b/strum_macros/src/helpers/mod.rs
index f30dbdc..5fbda5b 100644
--- a/strum_macros/src/helpers/mod.rs
+++ b/strum_macros/src/helpers/mod.rs
@@ -4,8 +4,7 @@ pub use self::type_props::HasTypeProperties;
pub use self::variant_props::HasStrumVariantProperties;
pub mod case_s... | 8 | 23 | 12 |
ec3297242c75a5d47945eeff0dc2ebef09eb7e9f | Peter Glotfelty 🚀 | 2020-07-26T04:41:15 | Replaced const fn count with associated constant. | diff --git a/strum/src/lib.rs b/strum/src/lib.rs
index 4623eb2..0f00094 100644
--- a/strum/src/lib.rs
+++ b/strum/src/lib.rs
@@ -192,12 +192,12 @@ pub trait EnumMessage {
/// }
/// ```
pub trait EnumProperty {
- fn get_str(&self, &str) -> Option<&'static str>;
- fn get_int(&self, &str) -> Option<usize> {
+ ... | 3 | 11 | 21 |
95645cac527864605a6466972d31c2a099c5ee56 | Peter Glotfelty | 2020-06-12T20:54:51 | Fix Display macro to handle fill/align (#95) | diff --git a/strum_macros/src/macros/strings/display.rs b/strum_macros/src/macros/strings/display.rs
index b2f24d3..2260b60 100644
--- a/strum_macros/src/macros/strings/display.rs
+++ b/strum_macros/src/macros/strings/display.rs
@@ -47,7 +47,7 @@ pub fn display_inner(ast: &syn::DeriveInput) -> TokenStream {
... | 2 | 9 | 1 |
a20ee16d6bb0d26c999767e4a9dd7d8ef013c563 | Casey Rodarmor | 2020-05-08T19:58:46 | Add repository link in strum crate Cargo.toml (#90)
* Add repository link in strum crate Cargo.toml
Having a repository link provides a helpful backlink to the crate in docs.rs
* Remove extra space character | diff --git a/strum/Cargo.toml b/strum/Cargo.toml
index cb7b46c..8fdaef1 100644
--- a/strum/Cargo.toml
+++ b/strum/Cargo.toml
@@ -10,6 +10,7 @@ categories = ["development-tools::procedural-macro-helpers", "parsing"]
documentation = "https://docs.rs/strum"
homepage = "https://github.com/Peternator7/strum"
+repository... | 1 | 1 | 0 |
de17e1c7a297c004692884932f94ca4e05f8c377 | Peter Glotfelty | 2020-02-10T23:58:11 | nth_back wasn't stablilized until 1.37 (#85) | diff --git a/strum_macros/src/macros/enum_iter.rs b/strum_macros/src/macros/enum_iter.rs
index 1572007..05978de 100644
--- a/strum_macros/src/macros/enum_iter.rs
+++ b/strum_macros/src/macros/enum_iter.rs
@@ -120,11 +120,7 @@ pub fn enum_iter_inner(ast: &syn::DeriveInput) -> TokenStream {
impl #impl_generics... | 1 | 1 | 5 |
8db6a313329299bdc3ba9a32e9d584a80ff01ba3 | Nevsor | 2019-12-19T22:44:30 | Implemented DoubleEndedIterator for EnumIter. (#60)
* Implemented DoubleEndedIterator for EnumIter.
* Fixed overlapping behaviour of next and next_back.
* Changed names of tests I accidentally swapped.
* Fixed size_hint() for EnumIter.
* Implemented more efficient version of nth() for EnumIter.
* Added ... | diff --git a/strum_macros/src/macros/enum_iter.rs b/strum_macros/src/macros/enum_iter.rs
index a62bfd8..4d58985 100644
--- a/strum_macros/src/macros/enum_iter.rs
+++ b/strum_macros/src/macros/enum_iter.rs
@@ -62,14 +62,24 @@ pub fn enum_iter_inner(ast: &syn::DeriveInput) -> TokenStream {
#[allow(missing_docs)]... | 2 | 114 | 12 |
eea32dbf7f2b316e65476c5399edd048abd48125 | Waffle Lapkin | 2019-12-12T21:39:10 | Const enum variants names (#75)
* Add implementing const `VARIANTS` by `EnumVariantsNames`, deprecate old `::variants`
* Move `const VARIANTS` to `VariantNames` trait
* Remove `VariantNames::variants` function | diff --git a/strum/src/lib.rs b/strum/src/lib.rs
index fb36882..7254479 100644
--- a/strum/src/lib.rs
+++ b/strum/src/lib.rs
@@ -221,7 +221,8 @@ pub trait EnumCount {
/// A trait for retrieving the names of each variant in Enum. This trait can
/// be autoderived by `strum_macros`.
pub trait VariantNames {
- fn va... | 3 | 10 | 18 |
bc8fa93ee86e8a842cc541cb890eb73bffcd9627 | Spanfile | 2019-11-24T04:58:10 | Move EnumVariantsNames into a trait which the macro implements (#74)
* Add VariantNames trait with the variants() function which the EnumVariantNames macro implements
* Consider generics in the impl block + use absolute path for the trait | diff --git a/strum/src/lib.rs b/strum/src/lib.rs
index 67f33ab..fb36882 100644
--- a/strum/src/lib.rs
+++ b/strum/src/lib.rs
@@ -40,7 +40,7 @@
//! | [Display] | Converts enum variants to strings |
//! | [AsRefStr] | Converts enum variants to `&'static str` |
//! | [IntoStaticStr] | Implements `From<MyEnum> for &'sta... | 3 | 30 | 5 |
e981f240d6e02c49f246b0fc4c7f4978e5ff364b | Herman Venter | 2019-11-17T01:33:14 | Add checks to guard against overflow in iterator methods. (#76) | diff --git a/strum_macros/src/macros/enum_iter.rs b/strum_macros/src/macros/enum_iter.rs
index afc6d8b..a62bfd8 100644
--- a/strum_macros/src/macros/enum_iter.rs
+++ b/strum_macros/src/macros/enum_iter.rs
@@ -83,12 +83,14 @@ pub fn enum_iter_inner(ast: &syn::DeriveInput) -> TokenStream {
#(#arms),*... | 2 | 7 | 2 |
00397fe0a31687b7373db15d521a451f201e85f2 | uHOOCCOOHu | 2019-06-23T11:39:28 | Add feature `derive` for re-exporting proc macros. | diff --git a/strum/Cargo.toml b/strum/Cargo.toml
index 59ba2e8..38fecdf 100644
--- a/strum/Cargo.toml
+++ b/strum/Cargo.toml
@@ -12,8 +12,14 @@ documentation = "https://docs.rs/strum"
homepage = "https://github.com/Peternator7/strum"
readme = "../README.md"
+[dependencies]
+strum_macros = { path = "../strum_macros"... | 6 | 21 | 2 |
640c0bb713a7417e310aff9e7fe8349814699e5b | Evgeniy Dushistov | 2019-07-29T15:26:29 | Implement serialize_all=UPPERCASE (#48)
* Implement serialize_all=UPPERCASE
* applying rustfmt 1.2.2-stable
* handling of all options listed in serde docs for compatibility
See https://serde.rs/container-attrs.html#container-attributes | diff --git a/strum_macros/src/case_style.rs b/strum_macros/src/case_style.rs
index 17acb17..afdb2fa 100644
--- a/strum_macros/src/case_style.rs
+++ b/strum_macros/src/case_style.rs
@@ -6,17 +6,27 @@ pub enum CaseStyle {
ShoutySnakeCase,
SnakeCase,
TitleCase,
+ UpperCase,
+ LowerCase,
+ Screaming... | 4 | 170 | 30 |
1f4a3b2534e5530be6250674fece604ae2ce810e | Peter Glotfelty 🚀 | 2019-03-04T07:33:01 | Revving package strum | diff --git a/strum/Cargo.toml b/strum/Cargo.toml
index 5232df1..8d68e37 100644
--- a/strum/Cargo.toml
+++ b/strum/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "strum"
-version = "0.13.0"
+version = "0.14.0"
authors = ["Peter Glotfelty <peglotfe@microsoft.com>"]
license = "MIT" | 1 | 1 | 1 |
7605c67ec6461b2e1075716627cd896f9ee4f210 | Tang King Fai | 2019-02-19T14:06:45 | Fix serialize_all in `AsRefStr`, `AsStaticStr` and `IntoStaticStr` (#42) | diff --git a/strum_macros/src/as_ref_str.rs b/strum_macros/src/as_ref_str.rs
index e824980..b22525c 100644
--- a/strum_macros/src/as_ref_str.rs
+++ b/strum_macros/src/as_ref_str.rs
@@ -1,7 +1,8 @@
use proc_macro2::TokenStream;
use syn;
-use helpers::{extract_attrs, extract_meta, is_disabled, unique_attr};
+use case... | 2 | 42 | 11 |
e58053b06502435ca277cfd2961991b2a080a354 | Dale Wijnand | 2019-02-18T20:44:22 | Allow enum count const to have missing docs (#43) | diff --git a/strum_macros/src/enum_count.rs b/strum_macros/src/enum_count.rs
index 712d508..6687cec 100644
--- a/strum_macros/src/enum_count.rs
+++ b/strum_macros/src/enum_count.rs
@@ -24,7 +24,7 @@ pub(crate) fn enum_count_inner(ast: &syn::DeriveInput) -> TokenStream {
}
}
- ... | 1 | 1 | 1 |
fe6c20a2491a3d851972782ece34f93c1c3d5234 | Evgeniy Dushistov | 2018-12-24T16:33:57 | implement From<Enum> for &'static str in case of AsStaticRef derive (#40)
* implement From<Enum> for &'static str in case of AsStaticRef derive
* make possible to use <&'static str>::from(Enum) without strum crate
* mark AsStaticRef trait as deprecated | diff --git a/strum/src/lib.rs b/strum/src/lib.rs
index 0ff91f1..5e596e8 100644
--- a/strum/src/lib.rs
+++ b/strum/src/lib.rs
@@ -372,7 +372,7 @@
//! assert_eq!(MyVariants::Variant0, MyEnum::Variant0(true).into());
//! }
//! ```
-//!
+//!
//! 8. `EnumCount`: for a given enum generates implementation... | 4 | 106 | 11 |
e75626a59f978fa2c9bc9eeed2ac40657e4a2711 | Peter Glotfelty 🚀 | 2018-09-26T20:02:53 | Revved Version Numbers | diff --git a/strum/Cargo.toml b/strum/Cargo.toml
index 055929d..9dfb61f 100644
--- a/strum/Cargo.toml
+++ b/strum/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "strum"
-version = "0.10.0"
+version = "0.11.0"
authors = ["Peter Glotfelty <peglotfe@microsoft.com>"]
license = "MIT"
@@ -13,7 +13,7 @@ homepage = "https:/... | 3 | 4 | 4 |
c91854c2f123737f90b89305fd4edd1e7c749d13 | らりお (YOSHIOKA Takuma) | 2018-06-23T16:02:34 | Bump dependencies (`syn` and `quote`) (#26)
syn-0.14 and quote-0.6 have been released, and they have breaking
changes. | diff --git a/strum_macros/Cargo.toml b/strum_macros/Cargo.toml
index cf1154f..ca34e0b 100644
--- a/strum_macros/Cargo.toml
+++ b/strum_macros/Cargo.toml
@@ -17,5 +17,6 @@ proc-macro = true
name = "strum_macros"
[dependencies]
-quote = "0.5.2"
-syn = { version = "0.13.7", features = ["parsing"] }
+proc-macro2 = "0.4... | 9 | 31 | 34 |
3988beefb9fbce167a3ead42b3f36397a9a83e6e | らりお (YOSHIOKA Takuma) | 2018-05-26T17:57:04 | Add `AsStaticRef` trait and let `derive(AsRefStr)` implement it (#24)
`#[derive(AsRefStr)]` will implement `AsStaticRef<str>`, and it
enables us to get `&'static str` by `AsStaticRef::<str>::as_static()`.
This will solve #23. | diff --git a/strum/src/lib.rs b/strum/src/lib.rs
index 8aba4a0..15061b3 100644
--- a/strum/src/lib.rs
+++ b/strum/src/lib.rs
@@ -515,3 +515,13 @@ pub trait EnumProperty {
Option::None
}
}
+
+
+/// A cheap reference-to-reference conversion. Used to convert a value to a
+/// reference value with `'static` ... | 3 | 27 | 1 |
e2ed13ad07bc6edb0c872cb67f4196bbda048047 | らりお (YOSHIOKA Takuma) | 2018-05-23T14:14:17 | Disable `missing_docs` lint for new types created by `EnumIter` (#25) | diff --git a/strum_macros/src/enum_iter.rs b/strum_macros/src/enum_iter.rs
index 2fd58ac..aa0cb48 100644
--- a/strum_macros/src/enum_iter.rs
+++ b/strum_macros/src/enum_iter.rs
@@ -54,6 +54,7 @@ pub fn enum_iter_inner(ast: &syn::DeriveInput) -> quote::Tokens {
arms.push(quote! { _ => ::std::option::Option::None })... | 1 | 1 | 0 |
179e8eac3502e4af9051a7d819f0a488c91d7463 | らりお (YOSHIOKA Takuma) | 2018-05-12T22:29:21 | Bump dependencies (mainly `syn` crate) (#22)
* Bump dependencies
* Cache intepreted meta to reduce memory allocation | diff --git a/strum_macros/Cargo.toml b/strum_macros/Cargo.toml
index 9c6879d..cf1154f 100644
--- a/strum_macros/Cargo.toml
+++ b/strum_macros/Cargo.toml
@@ -17,5 +17,5 @@ proc-macro = true
name = "strum_macros"
[dependencies]
-quote = "0.3.12"
-syn = "0.11.4"
+quote = "0.5.2"
+syn = { version = "0.13.7", features =... | 10 | 190 | 205 |
ae40df13830b25503d6159fca548fbcc6d26a288 | Malte Thiesen | 2018-04-16T16:43:32 | Implement Clone trait for enum iterators. (#18) | diff --git a/strum_macros/src/enum_iter.rs b/strum_macros/src/enum_iter.rs
index 3fc6db5..1e4fd7c 100644
--- a/strum_macros/src/enum_iter.rs
+++ b/strum_macros/src/enum_iter.rs
@@ -108,5 +108,14 @@ pub fn enum_iter_inner(ast: &syn::DeriveInput) -> quote::Tokens {
self.size_hint().0
}
... | 2 | 43 | 0 |
e0572b7f6be3c7adb31393a246e3e9e44bb8a17f | Peter Glotfelty 🚀 | 2018-03-10T21:10:00 | Updating the docs | diff --git a/strum/src/lib.rs b/strum/src/lib.rs
index e29db48..8aba4a0 100644
--- a/strum/src/lib.rs
+++ b/strum/src/lib.rs
@@ -14,8 +14,8 @@
//!
//! ```toml
//! [dependencies]
-//! strum = "0.8.0"
-//! strum_macros = "0.8.0"
+//! strum = "0.9.0"
+//! strum_macros = "0.9.0"
//! ```
//!
//! And add these lines to... | 1 | 2 | 2 |
af58a6d403dfaa4c76cc00916b6f2e1add603534 | らりお (YOSHIOKA Takuma) | 2017-08-24T02:18:23 | Add `derive(AsRefStr)` implementation (#10)
Implements AsRef<str> as a non-allocating alternative to deriving ToString. Docs will come later | diff --git a/strum_macros/src/as_ref_str.rs b/strum_macros/src/as_ref_str.rs
new file mode 100644
index 0000000..e060347
--- /dev/null
+++ b/strum_macros/src/as_ref_str.rs
@@ -0,0 +1,62 @@
+
+use quote;
+use syn;
+
+use helpers::{unique_attr, extract_attrs, is_disabled};
+
+pub fn as_ref_str_inner(ast: &syn::DeriveInpu... | 5 | 121 | 1 |
c9bba73f9b4ebba15b79410e3c0fc17fc68e5b7c | Peternator7 | 2017-07-01T15:12:00 | Updated Cargo.toml | diff --git a/strum_macros/Cargo.toml b/strum_macros/Cargo.toml
index a46b41b..b8ca7ba 100644
--- a/strum_macros/Cargo.toml
+++ b/strum_macros/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "strum_macros"
-version = "0.6.0"
+version = "0.6.1"
authors = ["Peter Glotfelty <peglotfe@microsoft.com>"]
license = "MIT" | 1 | 1 | 1 |
86a02a483341f43d136c4edd859d8d2862baf57c | kyren | 2017-06-30T20:53:13 | Add some missing absolute module paths | diff --git a/strum_macros/src/enum_iter.rs b/strum_macros/src/enum_iter.rs
index 53de92c..3718c6a 100644
--- a/strum_macros/src/enum_iter.rs
+++ b/strum_macros/src/enum_iter.rs
@@ -74,12 +74,12 @@ pub fn enum_iter_inner(ast: &syn::DeriveInput) -> quote::Tokens {
marker: ::std::marker::PhantomData #phantom_... | 1 | 3 | 3 |
bb2a37e9b6ed8706bafe0f71bb45ceb916b76a77 | Peternator7 | 2017-04-16T01:08:49 | Refactored deriviations into different files and added a ToString implementation | diff --git a/strum_macros/src/enum_iter.rs b/strum_macros/src/enum_iter.rs
new file mode 100644
index 0000000..53de92c
--- /dev/null
+++ b/strum_macros/src/enum_iter.rs
@@ -0,0 +1,100 @@
+use quote;
+use syn;
+
+use helpers::is_disabled;
+
+pub fn enum_iter_inner(ast: &syn::DeriveInput) -> quote::Tokens {
+ let name... | 10 | 606 | 436 |
033a376130c6c3008c8df7bfb36941a2a70cd2af | Peter Glotfelty | 2017-02-16T03:16:40 | Added more test cases and fixed a small bug in how EnumIter handles generics | diff --git a/strum/Cargo.toml b/strum/Cargo.toml
index 95aaacb..ae6c993 100644
--- a/strum/Cargo.toml
+++ b/strum/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "strum"
-version = "0.2.0"
+version = "0.2.1"
authors = ["Peter Glotfelty <peglotfe@microsoft.com>"]
license = "MIT"
@@ -13,7 +13,7 @@ homepage = "https://g... | 7 | 180 | 38 |
1c2548f215a5ce003e0c36eaf2d2e07c18cf5a9d | Alex Burka | 2017-02-14T20:22:30 | strum_macros: absolutize type paths | diff --git a/strum_macros/src/lib.rs b/strum_macros/src/lib.rs
index 9aa2b04..79576dd 100644
--- a/strum_macros/src/lib.rs
+++ b/strum_macros/src/lib.rs
@@ -111,7 +111,7 @@ fn from_string_inner(ast: &syn::DeriveInput) -> quote::Tokens {
};
let mut has_default = false;
- let mut default = quote! { _ => Er... | 1 | 16 | 16 |
088ca638e6efda9167f880c4582e61914a79f122 | Peter Glotfelty | 2017-02-12T07:07:06 | Fixed Cargo.toml in strum | diff --git a/strum/Cargo.toml b/strum/Cargo.toml
index 583ff14..e4fdbbf 100644
--- a/strum/Cargo.toml
+++ b/strum/Cargo.toml
@@ -8,12 +8,12 @@ description = "Helpful macros for working with enums and strings"
keywords = ["enum", "string", "macros", "proc-macros"]
categories = ["development-tools::procedural-macro-hel... | 1 | 2 | 2 |
dca3affc35e8f18c08eb24d228894278266355ad | Peter Glotfelty | 2017-02-12T07:05:15 | Fixed Cargo.toml for strum_macros | diff --git a/strum_macros/Cargo.toml b/strum_macros/Cargo.toml
index 7c5b39b..bfafceb 100644
--- a/strum_macros/Cargo.toml
+++ b/strum_macros/Cargo.toml
@@ -17,5 +17,5 @@ proc-macro = true
name = "strum_macros"
[dependencies]
-quote = "*"
-syn = "*"
+quote = "0.3.12"
+syn = "0.11.4" | 1 | 2 | 2 |
bbdceacd58b86384230cd7a040b90ab3ad368beb | Peter Glotfelty | 2017-02-11T19:42:32 | Fixed all the doc tests to actually run. | diff --git a/strum/Cargo.toml b/strum/Cargo.toml
index c745468..d51b111 100644
--- a/strum/Cargo.toml
+++ b/strum/Cargo.toml
@@ -3,4 +3,8 @@ name = "strum"
version = "0.1.0"
authors = ["Peter Glotfelty <peglotfe@microsoft.com>"]
-[dependencies]
+[dev-dependencies]
+strum_macros = { path = "../strum_macros" }
+
+[li... | 5 | 141 | 61 |
e9f28d827323c14d1b69b8ea9575496daecddf3c | Peter Glotfelty | 2017-02-09T08:23:55 | Added lots more documentation to the project. | diff --git a/strum/src/lib.rs b/strum/src/lib.rs
index 3d7fe6a..e2c3a90 100644
--- a/strum/src/lib.rs
+++ b/strum/src/lib.rs
@@ -27,7 +27,7 @@
//! // Import the traits we use into scope.
//! use strum::*;
//!
-//! #[derive(EnumString,EnumIter,EnumHelp)]
+//! #[derive(EnumString,EnumIter,EnumMessage)]
//! pub enum C... | 4 | 213 | 40 |
81ab1483bc9b9651fbcd817fc3af84101441f3ae | Peter Glotfelty | 2017-02-09T07:06:28 | Added support for lifetimes and generic bounds on enums. Also added support for a default case in from_str and a detailed_message | diff --git a/strum/src/lib.rs b/strum/src/lib.rs
index 6dea8db..3d7fe6a 100644
--- a/strum/src/lib.rs
+++ b/strum/src/lib.rs
@@ -72,7 +72,8 @@ pub trait IntoEnumIterator {
/// EnumMessages can be auto implemented by `strum_macros`. This trait is designed
/// to allow associating a piece of text with specific varian... | 6 | 154 | 44 |
61e4924c4992252f69ef4fea633ffbf20534a5cf | Peter Glotfelty | 2017-02-05T07:32:53 | Refactored some code to use more traits and few free functions | diff --git a/strum/src/lib.rs b/strum/src/lib.rs
index fcf68b4..6dea8db 100644
--- a/strum/src/lib.rs
+++ b/strum/src/lib.rs
@@ -1,15 +1,78 @@
+//! # Strum
+//!
+//! Strum = STRing enUM. It's a small set of macros and traits for working with and parsing enums.
+//! One possible use case is parsing command line args int... | 3 | 93 | 40 |
e4c762ee677b06948f7626520aed7698775677a5 | Peter Glotfelty | 2017-02-05T02:55:15 | Fixed the dependency links to point at github now that the project is being hosted remotely | diff --git a/strum/Cargo.toml b/strum/Cargo.toml
index 2b81d2a..c745468 100644
--- a/strum/Cargo.toml
+++ b/strum/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "strum"
version = "0.1.0"
-authors = ["Peter Glotfelty <glotfelty.2@osu.edu>"]
+authors = ["Peter Glotfelty <peglotfe@microsoft.com>"]
[dependencies]
diff -... | 2 | 2 | 2 |
37e366b3ed54adcea2138c4114d4196b32fa9dda | Jiahao XU | 2026-02-25T11:39:37 | Fix UnwindSafe auto impl (#459)
Add back `UnwindSafe` and `RefUnwindSafe` auto-impl
---------
Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> | diff --git a/crates/async-compression/src/generic/bufread/decoder.rs b/crates/async-compression/src/generic/bufread/decoder.rs
index 35dc0cb..ce827b3 100644
--- a/crates/async-compression/src/generic/bufread/decoder.rs
+++ b/crates/async-compression/src/generic/bufread/decoder.rs
@@ -2,7 +2,7 @@ use crate::{
codec... | 2 | 12 | 12 |
c39c6215cba0fb696160dc3b08cdc2d9d7cf278a | Diogo Sousa | 2026-02-24T12:03:25 | On error the encoder/decoder now emit everything it was able to decode. (#454)
Before this we would return the error and whatever we had in our
encode/decoded output buffer would be swallowed. | diff --git a/crates/async-compression/src/generic/bufread/decoder.rs b/crates/async-compression/src/generic/bufread/decoder.rs
index 9cad738..35dc0cb 100644
--- a/crates/async-compression/src/generic/bufread/decoder.rs
+++ b/crates/async-compression/src/generic/bufread/decoder.rs
@@ -2,7 +2,6 @@ use crate::{
codec... | 3 | 81 | 7 |
9df508b037dafb9a2d80bfd60fcd6679891abef1 | Diogo Sousa | 2026-02-18T10:27:42 | Fix update of bytes read in the encoder state machine. (#456)
Previously we were not updating the number of bytes read: we were just
changing the local binding of `read`. This means that read was always
zero and therefore the encoder never flushed.
Fixes #455 | diff --git a/crates/async-compression/src/generic/bufread/encoder.rs b/crates/async-compression/src/generic/bufread/encoder.rs
index c50f733..4ce90df 100644
--- a/crates/async-compression/src/generic/bufread/encoder.rs
+++ b/crates/async-compression/src/generic/bufread/encoder.rs
@@ -34,10 +34,10 @@ impl Encoder {
... | 2 | 77 | 5 |
0370b470db4dbe8f92a178320438e3094495a99a | Diogo Sousa | 2026-02-10T13:53:09 | Stop consuming input on errors in codecs. (#451)
Closes #450. | diff --git a/crates/compression-codecs/src/brotli/decoder.rs b/crates/compression-codecs/src/brotli/decoder.rs
index 82f9518..e16c398 100644
--- a/crates/compression-codecs/src/brotli/decoder.rs
+++ b/crates/compression-codecs/src/brotli/decoder.rs
@@ -42,7 +42,7 @@ impl BrotliDecoder {
let mut input_len = 0;
... | 9 | 30 | 31 |
f95a4b9203abc356d8a372f9d4ce8ad4661cce00 | Jiahao XU | 2026-02-07T03:35:53 | Revert "Fix decoding of empty response streams." (#446)
Reverts Nullus157/async-compression#444 | diff --git a/crates/async-compression/Cargo.toml b/crates/async-compression/Cargo.toml
index c2d3e5d..aa0313e 100644
--- a/crates/async-compression/Cargo.toml
+++ b/crates/async-compression/Cargo.toml
@@ -139,10 +139,6 @@ required-features = ["zlib", "tokio"]
name = "zstd_gzip"
required-features = ["zstd", "gzip", "t... | 3 | 1 | 34 |
e67f0b123af45c35a9d00e365650534a136254a8 | Muir Manders | 2026-02-06T11:45:11 | Fix decoding of empty response streams. (#444)
Previously we were returning "zstd stream did not finish", but now we
notice we got no data and transition directly to the done state. | diff --git a/crates/async-compression/Cargo.toml b/crates/async-compression/Cargo.toml
index 8671e5a..d30004f 100644
--- a/crates/async-compression/Cargo.toml
+++ b/crates/async-compression/Cargo.toml
@@ -139,6 +139,10 @@ required-features = ["zlib", "tokio"]
name = "zstd_gzip"
required-features = ["zstd", "gzip", "t... | 3 | 34 | 1 |
3705127e4a6e7378c28c422eb1bb9e6da78e2adb | tottoto | 2026-01-10T11:42:11 | chore: Set async-compression msrv (#440)
Sets `async-compression`'s `rust-version` config. | diff --git a/Cargo.toml b/Cargo.toml
index 4801fd6..7ae48c2 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -8,6 +8,7 @@ license = "MIT OR Apache-2.0"
repository = "https://github.com/Nullus157/async-compression"
categories = ["compression", "asynchronous"]
edition = "2018"
+rust-version = "1.83"
[workspace.dependenc... | 3 | 3 | 1 |
a063a3e0d66eada0035b0e812c7aec1c2a810193 | Jiahao XU | 2026-01-10T11:18:40 | Fix BufWriter::flush_buf: propagate error before reset (#438)
Fixed #435
Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> | diff --git a/crates/async-compression/src/generic/write/buf_writer.rs b/crates/async-compression/src/generic/write/buf_writer.rs
index 601fe57..9d3fc28 100644
--- a/crates/async-compression/src/generic/write/buf_writer.rs
+++ b/crates/async-compression/src/generic/write/buf_writer.rs
@@ -94,13 +94,13 @@ impl BufWriter ... | 1 | 2 | 2 |
30a69f79487e3d602e79093b8523e99470734f86 | tottoto | 2026-01-10T11:08:18 | chore: Switch futures_core::ready to standard library api (#436)
`std::task::ready` could be used instead of `futures_core::ready`. | diff --git a/Cargo.toml b/Cargo.toml
index 8a121aa..4801fd6 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -12,7 +12,6 @@ edition = "2018"
[workspace.dependencies]
compression-codecs = { version = "0.4.35", path = "crates/compression-codecs" }
compression-core = { version = "0.4.31", path = "crates/compression-core" }
... | 7 | 11 | 18 |
056b8c022ee6f88b410547c56f9270a9c6391e6e | Jiahao XU | 2025-12-11T07:00:09 | Add Crc checksum validation for gzip::header::Parser (#432)
Ensure the header is valid, [gzip
wikipedia](https://en.wikipedia.org/wiki/Gzip) says that:
> Two least significant bytes of the
[CRC-32](https://en.wikipedia.org/wiki/CRC-32) (ISO 3309) of all bytes
in the gzip file up to (not including) this field.
------... | diff --git a/crates/compression-codecs/src/gzip/decoder.rs b/crates/compression-codecs/src/gzip/decoder.rs
index 647959c..44064b0 100644
--- a/crates/compression-codecs/src/gzip/decoder.rs
+++ b/crates/compression-codecs/src/gzip/decoder.rs
@@ -64,7 +64,8 @@ impl GzipDecoder {
loop {
match &mut se... | 2 | 60 | 29 |
37748b37ca6df9f2b767fcf265ba9ed9d8ed6385 | Jiahao XU | 2025-12-07T10:36:48 | Optimize GzipEncoder to not allocate for header and footer (#431)
Fixed #397
Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> | diff --git a/crates/compression-codecs/src/gzip/encoder.rs b/crates/compression-codecs/src/gzip/encoder.rs
index 9b706d8..04c0d29 100644
--- a/crates/compression-codecs/src/gzip/encoder.rs
+++ b/crates/compression-codecs/src/gzip/encoder.rs
@@ -5,9 +5,9 @@ use std::io;
#[derive(Debug)]
enum State {
- Header(Part... | 1 | 8 | 8 |
1627bfccb8ce9a6d14fc319beb616ba2a2964c3b | Jiahao XU | 2025-12-07T09:56:06 | Optimize GzipDecoder (#430)
* Optimize GzipDecoder
- no heap allocation for footer which has fixed 8-byte size
- do not store unused header
- reset CrC instead of reassigning a new one
- optimize check_crc: rm unnecessary size check
Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com>
* Fix ... | diff --git a/crates/compression-codecs/src/gzip/decoder.rs b/crates/compression-codecs/src/gzip/decoder.rs
index 5a72b04..647959c 100644
--- a/crates/compression-codecs/src/gzip/decoder.rs
+++ b/crates/compression-codecs/src/gzip/decoder.rs
@@ -1,4 +1,4 @@
-use super::header::{self, Header};
+use super::header;
use cr... | 1 | 8 | 19 |
7bf1b99e7394b37982f38107abf4c7b8554e9962 | Jiahao XU | 2025-12-07T08:19:13 | Optimize gzip::header remove heap allocation (#428)
* Optimize gzip::header avoid heap allocation
Part of #397
Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com>
* Fix header
Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com>
* Fix typo
Signed-off-by: Jiahao XU <30436523+No... | diff --git a/crates/compression-codecs/src/gzip/header.rs b/crates/compression-codecs/src/gzip/header.rs
index 459fcb3..9c894e9 100644
--- a/crates/compression-codecs/src/gzip/header.rs
+++ b/crates/compression-codecs/src/gzip/header.rs
@@ -19,9 +19,9 @@ pub(super) struct Header {
enum State {
Fixed(PartialBuffer... | 1 | 15 | 17 |
02f81fe5b9f151db86e166a77217efea74f0a25a | Jiahao XU | 2025-11-18T14:11:45 | Refactor: Simplify `AsyncBufWrite` (#423)
Change `poll_partial_flush_buf` to return a `Buffer<'_>`, which include a public `WriteBuffer` field,
and a `Drop` impl so that it automatically advances the underlying `BufWriter`.
Rm the `produce` method as we no longer need it | diff --git a/crates/async-compression/src/generic/write/buf_write.rs b/crates/async-compression/src/generic/write/buf_write.rs
index 5ca9973..5a12b3a 100644
--- a/crates/async-compression/src/generic/write/buf_write.rs
+++ b/crates/async-compression/src/generic/write/buf_write.rs
@@ -1,3 +1,4 @@
+use super::Buffer;
us... | 4 | 36 | 59 |
ad3d41d347f027cfec4c8b78e3a15350db169fc9 | Jiahao XU | 2025-11-13T08:26:01 | Set msrv for codecs to 1.83 (#422)
* Set msrv for codecs to 1.74
Fixed #421
Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com>
* Bump codec msrv to 1.83
Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com>
---------
Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.git... | diff --git a/crates/compression-codecs/Cargo.toml b/crates/compression-codecs/Cargo.toml
index cdeaa33..a8142f7 100644
--- a/crates/compression-codecs/Cargo.toml
+++ b/crates/compression-codecs/Cargo.toml
@@ -10,6 +10,7 @@ edition.workspace = true
license.workspace = true
readme = "../../README.md"
repository.worksp... | 1 | 1 | 0 |
8947fed0e01237e6763b77e3fe15604dab7b6d32 | Jiahao XU | 2025-11-09T15:32:42 | Refactor `bufread::decoder`: Extract poll ready check (#418)
Move the check into the generic implementation,
instead of repeating | diff --git a/crates/async-compression/src/futures/bufread/generic/decoder.rs b/crates/async-compression/src/futures/bufread/generic/decoder.rs
index 16ddb54..642a1e1 100644
--- a/crates/async-compression/src/futures/bufread/generic/decoder.rs
+++ b/crates/async-compression/src/futures/bufread/generic/decoder.rs
@@ -23,... | 4 | 10 | 13 |
63a83ad3ab9621d4a17d3d43c49c46a4e6038391 | Jiahao XU | 2025-11-09T14:52:23 | Optimize condition for removing written data in BufWriter (#415)
* Optimize condition for removing written data in BufWriter
Do it strategically, when:
- it can use a memcpy instead of memmove to remove it
- when no space left for new data
Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com>
* ... | diff --git a/crates/async-compression/src/generic/write/buf_writer.rs b/crates/async-compression/src/generic/write/buf_writer.rs
index 22f677e..8db1797 100644
--- a/crates/async-compression/src/generic/write/buf_writer.rs
+++ b/crates/async-compression/src/generic/write/buf_writer.rs
@@ -136,7 +136,13 @@ impl BufWriter... | 1 | 7 | 1 |
e8944231dbcc65ef85e3f10dd92920ebe3c75ac7 | Jiahao XU | 2025-11-09T14:44:39 | feature: Add uninitialized output buffer support (#414)
* Add uninitialized buffer API to `WriteBuffer`
* Demono `WriteBuffer::copy_unwritten_from`
- reduce compile time
- having one version would make it easier to optimize for compiler
* Use bzip2 0.6.1 uninitialized API
* Use deflate64 0.1.10 uninitialized API... | diff --git a/crates/async-compression/src/tokio/bufread/generic/decoder.rs b/crates/async-compression/src/tokio/bufread/generic/decoder.rs
index 2daff04..832fe13 100644
--- a/crates/async-compression/src/tokio/bufread/generic/decoder.rs
+++ b/crates/async-compression/src/tokio/bufread/generic/decoder.rs
@@ -4,12 +4,11 ... | 18 | 374 | 186 |
47667f0edbe91fd73f32259c87a5aa8039024f18 | Jiahao XU | 2025-11-06T11:13:50 | Simplify `WriteBuffer`: Rm `unwritten_initialized_mut` (#413)
Mirror `tokio::io::ReadBuf`.
Also ensure `{in, out}put` is always advanced on error | diff --git a/crates/compression-codecs/src/brotli/decoder.rs b/crates/compression-codecs/src/brotli/decoder.rs
index 248a996..82f9518 100644
--- a/crates/compression-codecs/src/brotli/decoder.rs
+++ b/crates/compression-codecs/src/brotli/decoder.rs
@@ -36,15 +36,13 @@ impl BrotliDecoder {
input: &mut PartialBu... | 14 | 50 | 86 |
e6b38196eb8ad99f99f9d6a6e535db48c4cc6df2 | Bas Zalmstra | 2025-11-05T20:54:16 | fix: `UnexpectedEof` on truncated input (#412)
* Add generic truncated stream test to all decoders
Added a generic truncated stream test to the test_cases! macro that
automatically tests all decoders (bzip2, gzip, deflate, zlib, xz, lzma,
lz4, zstd, brotli) for proper handling of incomplete streams.
The test compres... | diff --git a/crates/async-compression/tests/utils/test_cases.rs b/crates/async-compression/tests/utils/test_cases.rs
index f32b0a8..af79c4b 100644
--- a/crates/async-compression/tests/utils/test_cases.rs
+++ b/crates/async-compression/tests/utils/test_cases.rs
@@ -231,6 +231,26 @@ macro_rules! io_test_cases {
... | 4 | 79 | 5 |
83a06fe3aa0869ca3add5c034cdd5bacf66cdcaf | Jiahao XU | 2025-11-05T07:27:18 | Update async-compression to use codecs v2 (#410)
* Adopt `{De, En}coderV2` in generic en/decoder impl
* Demono `generic::bufread::{De, En}coder` impl | diff --git a/crates/async-compression/src/futures/bufread/generic/decoder.rs b/crates/async-compression/src/futures/bufread/generic/decoder.rs
index 6b91142..16ddb54 100644
--- a/crates/async-compression/src/futures/bufread/generic/decoder.rs
+++ b/crates/async-compression/src/futures/bufread/generic/decoder.rs
@@ -1,1... | 8 | 161 | 125 |
2c13c1da8230f2a81508faefbbf0e7e0f40d5983 | Jiahao XU | 2025-11-04T15:03:01 | Dedup `write::Encoder` and simplify `write::Decoder` impl (#409)
* Dedup `write::Decoder::poll_write`
* Dedup `write::Encoder` impl
* Simplify `generic::write::Decoder` impl
- Do not use `ready!` or `?` propagation on last `poll` call
- Do not use `as_mut()` for last `poll` call | diff --git a/crates/async-compression/src/futures/write/generic/encoder.rs b/crates/async-compression/src/futures/write/generic/encoder.rs
index 4d7c448..98bb7bd 100644
--- a/crates/async-compression/src/futures/write/generic/encoder.rs
+++ b/crates/async-compression/src/futures/write/generic/encoder.rs
@@ -1,186 +1,12... | 5 | 246 | 393 |
7944821cc2de1ae0bc831e5f8ee504ba99caf28a | Jiahao XU | 2025-11-04T09:01:33 | Dedup `write::Decoder::poll_write` (#408) | diff --git a/crates/async-compression/src/generic/write/decoder.rs b/crates/async-compression/src/generic/write/decoder.rs
index 757ad47..7c2353c 100644
--- a/crates/async-compression/src/generic/write/decoder.rs
+++ b/crates/async-compression/src/generic/write/decoder.rs
@@ -27,7 +27,7 @@ impl Default for Decoder {
}... | 1 | 22 | 21 |
28f42724a68274e19699645923a5f80f4dc5654a | Jiahao XU | 2025-11-04T08:53:15 | Optimize `BufWriter::poll_*` method (#407)
- Simplify their code
- Only poll when there isn't enough buffer
- Only do internal `copy_within` to remove written data when necessary,
since `memmove` is expensive | diff --git a/crates/async-compression/src/generic/write/buf_writer.rs b/crates/async-compression/src/generic/write/buf_writer.rs
index 3dc0559..22f677e 100644
--- a/crates/async-compression/src/generic/write/buf_writer.rs
+++ b/crates/async-compression/src/generic/write/buf_writer.rs
@@ -47,7 +47,7 @@ impl BufWriter {
... | 1 | 25 | 18 |
52e104383c0fb007d5b213b50a502f0a838c0f74 | Jiahao XU | 2025-11-04T08:21:22 | Dedup `write::{AsyncBufWriter, BufWriter, Decoder}` (#406)
* Dedup `write::{decoder, AsyncBufWrite}`
* Dedup `BufWriter` impl
* Refactor `BufWriter` macro impl: Extract `get_poll_write`
To simplify code and avoid duplicate annoymous function generated
* Dedup `BufWriter::*flush_buf` | diff --git a/crates/async-compression/src/futures/write/buf_writer.rs b/crates/async-compression/src/futures/write/buf_writer.rs
index 13f23f1..847437f 100644
--- a/crates/async-compression/src/futures/write/buf_writer.rs
+++ b/crates/async-compression/src/futures/write/buf_writer.rs
@@ -2,218 +2,15 @@
// the `AsyncBu... | 12 | 526 | 817 |
386f59ebac3539c2424dfa0d8cbd3afe7d214620 | Jiahao XU | 2025-11-03T14:01:06 | Early return in `do_poll_read` instead of keep polling (#404)
if there're some data already written to
`output`, so that the next component in pipeline
can process it instead of being blocked. | diff --git a/crates/async-compression/src/generic/bufread/encoder.rs b/crates/async-compression/src/generic/bufread/encoder.rs
index 4187c9b..e6fe4b0 100644
--- a/crates/async-compression/src/generic/bufread/encoder.rs
+++ b/crates/async-compression/src/generic/bufread/encoder.rs
@@ -35,9 +35,12 @@ impl Encoder {
... | 1 | 6 | 3 |
6c0835eb5dd26cb6176acd0455437be13fdaadac | Jiahao XU | 2025-11-03T12:41:18 | Deduplicate `bufread::Encoder` impl (#402)
* Deduplicate `bufread::Encoder` impl
* Fix polling BufReader after EOF | diff --git a/crates/async-compression/src/futures/bufread/generic/encoder.rs b/crates/async-compression/src/futures/bufread/generic/encoder.rs
index 7c5236d..0496c2b 100644
--- a/crates/async-compression/src/futures/bufread/generic/encoder.rs
+++ b/crates/async-compression/src/futures/bufread/generic/encoder.rs
@@ -1,1... | 4 | 198 | 255 |
6fb985bd4adc27df37f5a1ee467b122b2f1589bb | Jiahao XU | 2025-11-03T12:31:48 | Rename `impl_do_poll_read!` to `impl_decoder!` (#403) | diff --git a/crates/async-compression/src/futures/bufread/generic/decoder.rs b/crates/async-compression/src/futures/bufread/generic/decoder.rs
index 802eaa5..6b91142 100644
--- a/crates/async-compression/src/futures/bufread/generic/decoder.rs
+++ b/crates/async-compression/src/futures/bufread/generic/decoder.rs
@@ -1,4... | 3 | 6 | 6 |
f072ce5a5971f6fd1fbd7414e7ace6dab0568220 | FineFindus | 2025-10-15T14:24:00 | feat: allow reading uncompressed size (#396)
* feat: add `DecodedSize` trait
Adds a new trait that to retrieve the size of the data when uncompressed. The
implementation of this trait on a format indicates that a format may support
retrieving the uncompressed size, however it's not guaranteed.
* feat(xz2): implement... | diff --git a/crates/compression-codecs/src/lib.rs b/crates/compression-codecs/src/lib.rs
index 0026507..1ad3ec1 100644
--- a/crates/compression-codecs/src/lib.rs
+++ b/crates/compression-codecs/src/lib.rs
@@ -97,3 +97,8 @@ pub trait Decode {
output: &mut PartialBuffer<impl AsRef<[u8]> + AsMut<[u8]>>,
) ->... | 5 | 46 | 5 |
1fa960f6b249753222dc216d2c17ce1072669437 | Jiahao XU | 2025-10-13T10:59:49 | Deduplicate `generic::bufread::Decoder` impl of tokio/futures-io (#391)
* Deduplicate `generic::bufread::Decoder` impl
Ref #384
* Use `ControlFlow` style API design to avoid trait object | diff --git a/crates/async-compression/src/futures/bufread/generic/decoder.rs b/crates/async-compression/src/futures/bufread/generic/decoder.rs
index 7bce212..802eaa5 100644
--- a/crates/async-compression/src/futures/bufread/generic/decoder.rs
+++ b/crates/async-compression/src/futures/bufread/generic/decoder.rs
@@ -1,1... | 6 | 212 | 284 |
8aa202e6df188caeb29f541bb744b27bbf8467d0 | Jiahao XU | 2025-10-06T01:54:48 | Re-export core in codecs (#395)
It's impossible to use codecs without also importing core
Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> | diff --git a/crates/compression-codecs/src/lib.rs b/crates/compression-codecs/src/lib.rs
index e7a4cd2..0026507 100644
--- a/crates/compression-codecs/src/lib.rs
+++ b/crates/compression-codecs/src/lib.rs
@@ -4,6 +4,8 @@
use std::io::Result;
+pub use compression_core as core;
+
#[cfg(feature = "brotli")]
pub mod... | 1 | 2 | 0 |
fcf91fd5ccaed2ef0414fcd575a2baa59124ff1a | Jiahao XU | 2025-10-02T15:41:59 | Disable nightly feature `doc_auto_cfg` on docsrs (#392)
* Rm doc_auto_cfg from codecs
Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com>
* Rm doc_auto_cfg from core
Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com>
* Rm doc_auto_cfg from async-compression
Signed-off-by: Jiah... | diff --git a/crates/async-compression/src/lib.rs b/crates/async-compression/src/lib.rs
index 58d33b1..ad64425 100644
--- a/crates/async-compression/src/lib.rs
+++ b/crates/async-compression/src/lib.rs
@@ -143,7 +143,7 @@
//! Enable the `xz-parallel` feature to enable multi-threading support.
//!
-#![cfg_attr(docsrs... | 3 | 3 | 3 |
15eb2e1aba66222991921a67e1352351401539c6 | Jiahao XU | 2025-09-25T10:55:18 | Use io::ErrorKind::OutOfMemory for xz2/bzip2 codecs (#387)
* Use error kind OutOfMemory for bzip2 encoder
Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com>
* Use OutOfMem for bzip2 decoder
Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com>
* Use OutOfMem for xz2 decoder
Sign... | diff --git a/crates/compression-codecs/src/bzip2/decoder.rs b/crates/compression-codecs/src/bzip2/decoder.rs
index 9364b3f..7b99338 100644
--- a/crates/compression-codecs/src/bzip2/decoder.rs
+++ b/crates/compression-codecs/src/bzip2/decoder.rs
@@ -80,7 +80,7 @@ impl Decode for BzDecoder {
// There was i... | 4 | 9 | 9 |
4ebce398dee27d9511888e1d161963cc8948d5e6 | Maciej Lechowski | 2025-09-25T08:39:33 | Flush compressed data out of encoders more often (#383)
* Flush compressed data out of encoders more often
Currently flush() is not getting called so compressed output is not
returned to the client the encoder until input is fully read(). In my use case,
flushing more often is necessary as otherwise it appears to the... | diff --git a/crates/async-compression/src/futures/bufread/generic/encoder.rs b/crates/async-compression/src/futures/bufread/generic/encoder.rs
index e30dc38..7c5236d 100644
--- a/crates/async-compression/src/futures/bufread/generic/encoder.rs
+++ b/crates/async-compression/src/futures/bufread/generic/encoder.rs
@@ -14,... | 3 | 78 | 22 |
5072f4a6e3848c4a8b386023ed39286c7cf260cd | Jiahao XU | 2025-08-31T04:23:40 | rm unused dep from async-compression and compression-codecs (#381)
* rm unused dep from async-compression
Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com>
* fix async-compression: add back tokio and futures-io
Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com>
* fix test: ad... | diff --git a/Cargo.toml b/Cargo.toml
index 31e7b74..bd89cee 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -13,7 +13,6 @@ edition = "2018"
compression-codecs = { version = "0.4.29", path = "crates/compression-codecs" }
compression-core = { version = "0.4.29", path = "crates/compression-core" }
futures-core = { version ... | 3 | 24 | 27 |
ccefbeb8d4e030293b1ca08a0aef1c51d143e24b | Jiahao XU | 2025-08-23T12:00:19 | Refactor: update use of compression_core::assert_* (#375)
* Refactor tokio/write/encoder.rs
Rm unnecessary fm definition
Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com>
* Refactor decoder.rs
Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com>
* Refactor encoder.rs
Signed-o... | diff --git a/src/futures/bufread/macros/decoder.rs b/src/futures/bufread/macros/decoder.rs
index 1ab2d67..a98dc8f 100644
--- a/src/futures/bufread/macros/decoder.rs
+++ b/src/futures/bufread/macros/decoder.rs
@@ -115,14 +115,12 @@ macro_rules! decoder {
}
const _: () = {
- fn _assert() {
... | 8 | 40 | 56 |
776b25fbaf8a0b54a98cc092fc296c68da0467c4 | Jiahao XU | 2025-08-23T11:32:55 | Refactor compression_core::util (#373)
- mark assert_* as const
- relax generic bound on PartialBuffer struct definition
- use mem::take instead of mem::replate
Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> | diff --git a/crates/compression-core/src/util.rs b/crates/compression-core/src/util.rs
index 1d96a1a..58720a4 100644
--- a/crates/compression-core/src/util.rs
+++ b/crates/compression-core/src/util.rs
@@ -1,8 +1,8 @@
-pub fn _assert_send<T: Send>() {}
-pub fn _assert_sync<T: Sync>() {}
+pub const fn _assert_send<T: Sen... | 1 | 5 | 5 |
154da155291a3d7d9bdc24dd26261427383c620a | Jiahao XU | 2025-08-23T09:35:47 | Fix Cargo.toml: add back version for async-compression (#372)
Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> | diff --git a/Cargo.toml b/Cargo.toml
index 0afb490..2d5d035 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -7,7 +7,6 @@ authors = ["Wim Looman <wim@nemo157.com>", "Allen Bui <fairingrey@gmail.com>"]
license = "MIT OR Apache-2.0"
repository = "https://github.com/Nullus157/async-compression"
categories = ["compression", ... | 1 | 1 | 1 |
bba76aef8bf8f48437ba4de611e66c58ae971714 | Jiahao XU | 2025-08-23T09:18:16 | Have separate package.version field for compression-* (#369) | diff --git a/Cargo.toml b/Cargo.toml
index 85782c7..0afb490 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -22,7 +22,6 @@ name = "async-compression"
description = """
Adaptors between compression crates and Rust's modern asynchronous IO types.
"""
-version.workspace = true
authors.workspace = true
license.workspace =... | 3 | 2 | 3 |
631501b5035736aa7870be2376bc2013ad753f08 | Jiahao XU | 2025-08-23T09:09:48 | Re-export compression_codecs as codecs (#368) | diff --git a/src/futures/bufread/generic/decoder.rs b/src/futures/bufread/generic/decoder.rs
index b0f96b3..7bce212 100644
--- a/src/futures/bufread/generic/decoder.rs
+++ b/src/futures/bufread/generic/decoder.rs
@@ -1,4 +1,4 @@
-use crate::codec::Decode;
+use crate::codecs::Decode;
use crate::core::util::PartialBuffe... | 18 | 65 | 65 |
ceae00f76d7d6cdedee5c1412bcb7ea6a371a03b | Jiahao XU | 2025-08-23T06:02:19 | Fix breaking API change (#366)
* Fix breaking API change
Re-export Level and module codec::{zstd, lz4, brotli}::parame
Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com>
* Fix re-export of mod in lib.rs
Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com>
* Format lib.rs
Signe... | diff --git a/src/lib.rs b/src/lib.rs
index 4578a62..73b0fdc 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -162,3 +162,14 @@ pub mod tokio;
pub use compression_codecs as codec;
pub use compression_core as core;
+
+pub use core::Level;
+
+#[cfg(feature = "zstd")]
+pub use codec::zstd::params as zstd;
+
+#[cfg(feature =... | 1 | 11 | 0 |
d0153939b3f5335c7344e6807e2bd24b5068d23b | Jiahao XU | 2025-08-23T03:47:52 | Fix docs.rs build for compression-codecs (#365)
Enable all feature and cfg docsrs
Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> | diff --git a/crates/compression-codecs/Cargo.toml b/crates/compression-codecs/Cargo.toml
index 53bd4af..053262d 100644
--- a/crates/compression-codecs/Cargo.toml
+++ b/crates/compression-codecs/Cargo.toml
@@ -11,6 +11,10 @@ edition.workspace = true
repository.workspace = true
readme = "../../README.md"
+[package.me... | 1 | 4 | 0 |
26bf7da0645183ed460c1430d5139ce6616a7bb6 | Jiahao XU | 2025-08-11T21:13:42 | Fix doc link for futures-io (#361)
Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> | diff --git a/src/lib.rs b/src/lib.rs
index 3b75e4a..2635f1f 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -32,7 +32,7 @@
#![allow(unexpected_cfgs)]
#![cfg_attr(
feature = "futures-io",
- doc = "[`futures-io`] | [`futures::io::AsyncBufRead`](futures_io::AsyncBufRead), [`futures::io::AsyncWrite`](futures_io::Asyn... | 1 | 1 | 1 |
fd529c6ded57d29cb1910009e4ac2389b24a3545 | Rob Ede | 2025-07-13T23:19:32 | fix(zstd): fastest level now does compression (#357) | diff --git a/src/lib.rs b/src/lib.rs
index 5ecc6dd..3b75e4a 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -254,8 +254,15 @@ impl Level {
#[cfg(feature = "zstd")]
fn into_zstd(self) -> i32 {
let (fastest, best) = libzstd::compression_level_range().into_inner();
+
+ // NOTE: zstd's "fastest" level... | 1 | 8 | 1 |
52d7d4c146abd3058dd22dc3201daad210ecbd47 | Jiahao XU | 2025-06-09T15:13:20 | Fix fmt in decoder.rs
Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> | diff --git a/src/codec/xz2/decoder.rs b/src/codec/xz2/decoder.rs
index a51f714..1c111fd 100644
--- a/src/codec/xz2/decoder.rs
+++ b/src/codec/xz2/decoder.rs
@@ -74,9 +74,7 @@ impl Decode for Xz2Decoder {
match status {
Status::Ok => Ok(false),
Status::StreamEnd => Ok(true),
- ... | 1 | 1 | 3 |
656949713fa2f6e397ec4add2189d9e9865b34c1 | Jiahao XU | 2025-06-09T15:11:50 | Fix tokio write generics decoder.rs
Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> | diff --git a/src/tokio/write/generic/decoder.rs b/src/tokio/write/generic/decoder.rs
index a7865d9..075c1ec 100644
--- a/src/tokio/write/generic/decoder.rs
+++ b/src/tokio/write/generic/decoder.rs
@@ -176,7 +176,7 @@ impl<W: AsyncWrite, D: Decode> AsyncWrite for Decoder<W, D> {
ready!(self.as_mut().project... | 1 | 1 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.