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
59dcea86e85b0d0ecdb4b735de2a3be64c3fe76d
Moritz Borcherding
2019-09-10T16:43:10
various fixes for indexing and when to update fse states
diff --git a/src/block/block_decoder.rs b/src/block/block_decoder.rs index 7be206c..6c148c0 100644 --- a/src/block/block_decoder.rs +++ b/src/block/block_decoder.rs @@ -163,10 +163,11 @@ impl BlockDecoder { let mut seq_section = SequencesHeader::new(); let bytes_in_sequence_header = seq_section.parse_...
6
101
37
7c20009d512638a3dcca8ddd41b0b9d4d4eecb99
Moritz Borcherding
2019-09-10T13:49:47
u8 counter were too small, changed to u32
diff --git a/src/decoding/fse.rs b/src/decoding/fse.rs index 33d6970..53a3f1a 100644 --- a/src/decoding/fse.rs +++ b/src/decoding/fse.rs @@ -6,7 +6,7 @@ pub struct FSETable { pub accuracy_log: u8, symbol_probablilities: Vec<i32>, //used while building the decode Vector - symbol_counter: Vec<u8>, + sym...
1
1
1
1b342f8960e8b746db704b216a2b148de2b46a37
Moritz Borcherding
2019-09-10T13:47:49
fixed fse table building
diff --git a/src/block/block_decoder.rs b/src/block/block_decoder.rs index e4c9092..7be206c 100644 --- a/src/block/block_decoder.rs +++ b/src/block/block_decoder.rs @@ -133,9 +133,9 @@ impl BlockDecoder { let mut section = LiteralsSection::new(); let bytes_in_literals_header = section.parse_from_heade...
7
129
53
27e8cab73aa916a633555100ca8fa97c52450b01
Moritz Borcherding
2019-09-09T17:59:43
the bug search begins... added outpur for some of the steps while decoding
diff --git a/src/block/block.rs b/src/block/block.rs index c089627..9c3d4df 100644 --- a/src/block/block.rs +++ b/src/block/block.rs @@ -5,6 +5,18 @@ pub enum BlockType { Reserved, } +impl std::fmt::Display for BlockType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> Result<(), std::fmt::Error> { + ...
5
34
2
15d171315aab3875d918c9804341c4255144258e
Moritz Borcherding
2019-09-09T17:25:53
removed old todos
diff --git a/src/block/literals_section_decoder.rs b/src/block/literals_section_decoder.rs index b65a3a0..b24ad34 100644 --- a/src/block/literals_section_decoder.rs +++ b/src/block/literals_section_decoder.rs @@ -25,7 +25,6 @@ pub fn decode_literals( let source = &source[0..section.compressed_size.unwrap()...
2
0
2
faab477324bb68739a677628a1044ae881e02d7a
Moritz Borcherding
2019-09-09T17:22:40
only let literalsection decoding access the relevant bytes
diff --git a/src/block/block_decoder.rs b/src/block/block_decoder.rs index 904e274..adcfe83 100644 --- a/src/block/block_decoder.rs +++ b/src/block/block_decoder.rs @@ -1,6 +1,7 @@ use super::block::BlockHeader; use super::block::BlockType; use super::literals_section::LiteralsSection; +use super::literals_section::...
2
14
3
3e51ee1b10a5c36489626f7c4a7db29a6680191a
Moritz Borcherding
2019-09-09T17:13:50
added decoding of the sequences section
diff --git a/src/block/block_decoder.rs b/src/block/block_decoder.rs index 01c8ad8..904e274 100644 --- a/src/block/block_decoder.rs +++ b/src/block/block_decoder.rs @@ -3,6 +3,7 @@ use super::block::BlockType; use super::literals_section::LiteralsSection; use super::literals_section_decoder::decode_literals; use sup...
7
230
5
7e8fdf411b770fb5d5c4694440c98e660a132856
Moritz Borcherding
2019-09-09T15:48:04
added sequencesection header decoding
diff --git a/src/block/block_decoder.rs b/src/block/block_decoder.rs index 2df16db..01c8ad8 100644 --- a/src/block/block_decoder.rs +++ b/src/block/block_decoder.rs @@ -2,6 +2,7 @@ use super::block::BlockHeader; use super::block::BlockType; use super::literals_section::LiteralsSection; use super::literals_section_de...
3
97
10
ec9c690b10b466ca4ec243c8bdc9403d53454063
Moritz Borcherding
2019-09-09T15:20:04
added decompression of huffman compressed literals
diff --git a/src/block/literals_section_decoder.rs b/src/block/literals_section_decoder.rs index 0a98853..b65a3a0 100644 --- a/src/block/literals_section_decoder.rs +++ b/src/block/literals_section_decoder.rs @@ -1,8 +1,15 @@ +use super::super::decoding::bit_reader::BitReader; +use super::super::decoding::huff0::Huffma...
5
88
24
b00df65c7de5ae1f01028182204a15e250480c8b
Moritz Borcherding
2019-09-09T11:59:29
added test that tries to read all blocks and fixed subsequently found bugs
diff --git a/src/block/block_decoder.rs b/src/block/block_decoder.rs index c7be903..2df16db 100644 --- a/src/block/block_decoder.rs +++ b/src/block/block_decoder.rs @@ -58,6 +58,8 @@ impl BlockDecoder { } } } + + ...
6
63
15
41037a458cb14ea3c8b32de27f262ed99f6f5a97
Moritz Borcherding
2019-09-09T11:17:02
more codepathes in test
diff --git a/src/block/block_decoder.rs b/src/block/block_decoder.rs index fc217cb..c7be903 100644 --- a/src/block/block_decoder.rs +++ b/src/block/block_decoder.rs @@ -165,7 +165,7 @@ impl BlockDecoder { Err(m) => return Err(m), }; - let block_size = self.block_content_size_unchecked(); ...
6
79
13
fcc1931665f5b915a207e5cc62cdf1267ab3a63b
Moritz Borcherding
2019-09-09T11:16:50
bugfix! if single_segment_flag is set do NOT read window_descriptor
diff --git a/src/frame.rs b/src/frame.rs index 8ddcb00..52f3d00 100644 --- a/src/frame.rs +++ b/src/frame.rs @@ -4,7 +4,7 @@ pub const MAX_WINDOW_SIZE: u64 = (1 << 41) + 7 * (1 << 38); pub struct Frame { magic_num: u32, - header: FrameHeader, + pub header: FrameHeader, } pub struct FrameHeader { @@ -1...
1
15
11
169039526a83c626c5285371d08b49b6ab7e0c62
Moritz Borcherding
2019-09-09T10:32:57
more code towards actually decompressing blocks
diff --git a/src/block/block_decoder.rs b/src/block/block_decoder.rs index ff0b8ae..fc217cb 100644 --- a/src/block/block_decoder.rs +++ b/src/block/block_decoder.rs @@ -1,5 +1,7 @@ use super::block::BlockHeader; use super::block::BlockType; +use super::literals_section::LiteralsSection; +use super::literals_section_d...
4
118
13
b0aa435a6e5880ad1ee15a04cb7b2820697cf6bd
Moritz Borcherding
2019-09-09T09:59:53
added reading weights for the huffman table
diff --git a/src/decoding/bit_reader_reverse.rs b/src/decoding/bit_reader_reverse.rs index f56d20b..bd6ce7f 100644 --- a/src/decoding/bit_reader_reverse.rs +++ b/src/decoding/bit_reader_reverse.rs @@ -4,6 +4,10 @@ pub struct BitReaderReversed<'s> { } impl<'s> BitReaderReversed<'s> { + pub fn bits_remaining(&self...
4
117
27
2cfff1b94a68ca3aeb25f6c77ad48c09d37c6105
Moritz Borcherding
2019-09-08T20:14:45
fixes on port of huffman table building
diff --git a/src/decoding/huff0.rs b/src/decoding/huff0.rs index 03ee49f..a16a7a3 100644 --- a/src/decoding/huff0.rs +++ b/src/decoding/huff0.rs @@ -35,7 +35,9 @@ impl HuffmanDecoder { //TODO read weights let _ = source; self.build_table_from_weights()?; - Ok(100 /* number of bytes nee...
1
40
27
74ed64f2f9a3f4fd8ab7add178dbc674d042c326
Moritz Borcherding
2019-09-08T19:52:32
added check for max_bits. should not exceed 11
diff --git a/src/decoding/huff0.rs b/src/decoding/huff0.rs index bb453ed..03ee49f 100644 --- a/src/decoding/huff0.rs +++ b/src/decoding/huff0.rs @@ -34,8 +34,8 @@ impl HuffmanDecoder { //TODO read weights let _ = source; - self.build_table_from_weights(); - Ok(100) + self.build_...
1
9
3
ccd311b7a9164411e5d9d141f98fa78ab94a113a
Moritz Borcherding
2019-09-08T19:49:27
added generating huffman decoding table from weights with help of the educational decoder from facebook/zstd
diff --git a/src/decoding/huff0.rs b/src/decoding/huff0.rs index d602b17..bb453ed 100644 --- a/src/decoding/huff0.rs +++ b/src/decoding/huff0.rs @@ -1,15 +1,113 @@ -use std::collections::HashMap; +use super::bit_reader::BitReader; pub struct HuffmanDecoder { - decode: HashMap<u8, u8>, + decode: Vec<Entry>, + ...
1
101
3
c23488a612a58b9a36ec5306270246719010bd64
Moritz Borcherding
2019-09-08T11:15:51
skeleton for literalssection decoding
diff --git a/src/block/literals_section.rs b/src/block/literals_section.rs index 7a93701..7362666 100644 --- a/src/block/literals_section.rs +++ b/src/block/literals_section.rs @@ -1,7 +1,8 @@ pub struct LiteralsSection { - regenerated_size: u32, - compressed_size: Option<u32>, - num_streams: Option<u8>, + ...
4
61
20
50912502696d88d3640fa5e1974e8de08e3190a4
Moritz Borcherding
2019-09-08T10:49:55
added literalssection header decoding
diff --git a/src/block/literals_section.rs b/src/block/literals_section.rs new file mode 100644 index 0000000..7a93701 --- /dev/null +++ b/src/block/literals_section.rs @@ -0,0 +1,119 @@ +pub struct LiteralsSection { + regenerated_size: u32, + compressed_size: Option<u32>, + num_streams: Option<u8>, +} + +pub ...
2
121
1
6b4c9a28a8f7af4fa4ace9766dfac99082211800
Moritz Borcherding
2019-09-08T09:48:43
api changes to bitreader used in fse decoder
diff --git a/src/decoding/bit_reader.rs b/src/decoding/bit_reader.rs index 751a30f..7d8645b 100644 --- a/src/decoding/bit_reader.rs +++ b/src/decoding/bit_reader.rs @@ -63,7 +63,8 @@ impl<'s> BitReader<'s> { bit_shift += 8; } - let val_las_byte = (self.source[self.idx / 8] as ...
3
10
7
ff42e776724c7d8c3fcc03276987b33d43a37c47
Moritz Borcherding
2019-09-08T09:45:27
added a reverse bitreader
diff --git a/src/decoding/bit_reader.rs b/src/decoding/bit_reader.rs index c8e4c61..751a30f 100644 --- a/src/decoding/bit_reader.rs +++ b/src/decoding/bit_reader.rs @@ -1,11 +1,13 @@ -pub struct BitReader { +pub struct BitReader<'s> { idx: usize, //index counts bits already read + source: &'s [u8], } -impl B...
4
112
21
a434566a49454e60e91f485e4997faf0002ccd82
Moritz Borcherding
2019-09-07T13:56:11
renamed build_probabilities
diff --git a/src/decoding/fse.rs b/src/decoding/fse.rs index 3615448..46d9682 100644 --- a/src/decoding/fse.rs +++ b/src/decoding/fse.rs @@ -8,6 +8,7 @@ pub struct FSEDecoder { symbol_probablilities: Vec<i32>, //used while building the decode Vector } +#[derive(Copy, Clone)] struct Entry { base_line: usiz...
1
96
6
4eb477aefb39bd721ac4670e6b0aab2249eb0f78
Moritz Borcherding
2019-09-07T12:00:40
fixed counting of -1 probablities
diff --git a/src/decoding/fse.rs b/src/decoding/fse.rs index b9378dd..3615448 100644 --- a/src/decoding/fse.rs +++ b/src/decoding/fse.rs @@ -26,11 +26,19 @@ fn highest_bit_set(x: u32) -> u32 { } impl FSEDecoder { - //returns how many BYTEs (not bits) were read while building the decoder + pub fn new() -> FSED...
1
16
4
7a0aab9f67ffd96597eedb5dddb8fcba4cbd99d9
Moritz Borcherding
2019-09-07T11:51:02
fixed the log so it actually returns the number of the highest set bit in a u32
diff --git a/src/decoding/fse.rs b/src/decoding/fse.rs index d0393f1..b9378dd 100644 --- a/src/decoding/fse.rs +++ b/src/decoding/fse.rs @@ -20,9 +20,9 @@ const fn num_bits<T>() -> usize { std::mem::size_of::<T>() * 8 } -fn log_2(x: u32) -> u32 { +fn highest_bit_set(x: u32) -> u32 { assert!(x > 0); - nu...
1
3
3
fae75d3e44ac87bcc45570a9838134cda2d08c8c
Moritz Borcherding
2019-09-07T11:41:54
added reading fse-probability-distribution from a byte-slice
diff --git a/src/decoding/bit_reader.rs b/src/decoding/bit_reader.rs new file mode 100644 index 0000000..c8e4c61 --- /dev/null +++ b/src/decoding/bit_reader.rs @@ -0,0 +1,74 @@ +pub struct BitReader { + idx: usize, //index counts bits already read +} + +impl BitReader { + pub fn new() -> BitReader { + BitR...
5
191
19
46fe9a8fd27e4bd0e00c8c566e122c59e37e4808
Moritz Borcherding
2019-09-05T19:57:35
more parts of the decoding parts in place ready to be implemented
diff --git a/src/decoding/mod.rs b/src/decoding/mod.rs index 1fab18d..288f79d 100644 --- a/src/decoding/mod.rs +++ b/src/decoding/mod.rs @@ -2,4 +2,5 @@ pub mod scratch; pub mod decodebuffer; pub mod fse; -pub mod huff0; \ No newline at end of file +pub mod huff0; +pub mod offset_history; \ No newline at end of file...
3
11
3
aff95673819a5ff4f30391b076e4b08d4a257d2c
Moritz Borcherding
2019-09-05T17:54:49
first ideas for the decoding parts so that most of the allocations can be reused
diff --git a/src/block/block_decoder.rs b/src/block/block_decoder.rs index 117bbf3..ff0b8ae 100644 --- a/src/block/block_decoder.rs +++ b/src/block/block_decoder.rs @@ -28,7 +28,7 @@ impl BlockDecoder { pub fn decode_block_content( &mut self, header: &BlockHeader, - workspace: &mut Decoder...
6
89
7
cea0f0d27151a9f821b767f2714e8cfd7d53f9b3
Moritz Borcherding
2019-09-05T11:45:03
generalized the path to the testfile
diff --git a/src/tests/mod.rs b/src/tests/mod.rs index b9bb668..cefbbad 100644 --- a/src/tests/mod.rs +++ b/src/tests/mod.rs @@ -4,7 +4,7 @@ fn test_frame_header_reading() { use crate::frame; use std::fs; - let mut content = fs::File::open("/home/moritz/rust/zstd-rs/test_img.zst").unwrap(); + let mut ...
1
1
1
ee9e334fdd5bd5dac16ec882ec4bced1d6c11bc9
Yevhenii Reizner
2023-10-19T07:31:52
Fix crate docs. Closes #60
diff --git a/src/lib.rs b/src/lib.rs index 303629e..2f2be22 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -5,7 +5,6 @@ If you think that this library doesn't support some feature, it's probably inten - No help generation - Only flags, options, free arguments and subcommands are supported -- No combined flags (like `-...
1
3
3
c7b7e3725995a760bc9ac61b9f590e8658561197
Liigo Zhuang
2023-01-09T13:52:23
Fix a typo.
diff --git a/examples/app.rs b/examples/app.rs index 767b183..fc53879 100644 --- a/examples/app.rs +++ b/examples/app.rs @@ -58,7 +58,7 @@ fn parse_args() -> Result<AppArgs, pico_args::Error> { // Parses an optional value from `&str` using a specified function. width: pargs.opt_value_from_fn("--width"...
1
1
1
882e80af16e07bf1021131b88b70a251a9a2cbdd
Yevhenii Reizner
2022-06-04T11:07:37
Fix warnings.
diff --git a/examples/app.rs b/examples/app.rs index 6374f5e..767b183 100644 --- a/examples/app.rs +++ b/examples/app.rs @@ -1,3 +1,5 @@ +#![allow(dead_code)] + const HELP: &str = "\ App diff --git a/examples/dash_dash.rs b/examples/dash_dash.rs index 212f5f6..0a1dba3 100644 --- a/examples/dash_dash.rs +++ b/exampl...
2
4
0
7b410bdac71f079b0bd4bd5eb24de5239fe2e51d
Yevhenii Reizner
2022-06-04T11:06:08
Code format fixes.
diff --git a/src/lib.rs b/src/lib.rs index cff6c26..2fa2fc1 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -25,7 +25,8 @@ If you think that this library doesn't support some feature, it's probably inten The optional space is only applicable for short keys because `--keyvalue` would be ambiguous. - `combined-flags` -...
1
4
2
8659986b896d733ef8fbe3eafb728ee9cd13572f
glts
2022-06-04T10:43:31
Separate error cause with ':' in Display implementations.
diff --git a/src/lib.rs b/src/lib.rs index ba0956e..cff6c26 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -82,10 +82,10 @@ impl Display for Error { write!(f, "the '{}' option doesn't have an associated value", key) } Error::Utf8ArgumentParsingFailed { value, cause } => { - ...
2
5
5
74800b42d2db9daa03b8159215c749af6be08f54
Riccardo Attilio Galli
2021-06-03T10:15:55
Do not search for combined flags in long options.
diff --git a/src/lib.rs b/src/lib.rs index 3de754b..c0bac3a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -173,13 +173,13 @@ impl Arguments { true } else { #[cfg(feature = "combined-flags")] - // Combined flags only work of the short flag is a single character + //...
2
17
2
b3ca1e92750670aac7fa1296fe782c1a760e275c
jneem
2021-06-02T17:31:39
Update `contains` docs.
diff --git a/src/lib.rs b/src/lib.rs index 438e8dc..3de754b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -154,9 +154,14 @@ impl Arguments { /// Checks that arguments contain a specified flag. /// - /// Searches through all argument, not only the first/next one. + /// Searches through all arguments, not...
1
7
2
c9491b766e477732e03007fe45be3fc89cb5ee83
Wesley Moore
2021-04-18T11:02:40
Clarify that from_env uses args_os
diff --git a/src/lib.rs b/src/lib.rs index 991ed76..250195e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -114,11 +114,11 @@ impl Arguments { Arguments(args) } - /// Creates a parser from [`env::args`]. + /// Creates a parser from [`env::args_os`]. /// /// The executable path will be remov...
1
2
2
9882928cba269d4e75f81a9949567a92ac677bde
Evgeniy Reizner
2020-12-27T07:32:47
Simplify take_first implementation.
diff --git a/src/lib.rs b/src/lib.rs index 410378c..722238f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -601,11 +601,7 @@ impl Arguments { if self.0.is_empty() { Ok(None) } else { - // A simple take_first() implementation. - let mut value = OsString::new(); - ...
1
2
10
05dd2966f416be9bf52081bdceba2c8119f9ea25
Joshua Nelson
2020-11-26T05:41:44
Add an example of using `--` with `from_vec`
diff --git a/examples/dash_dash.rs b/examples/dash_dash.rs new file mode 100644 index 0000000..282aaac --- /dev/null +++ b/examples/dash_dash.rs @@ -0,0 +1,39 @@ +use std::ffi::OsString; + +#[derive(Debug)] +struct Args { + forwarded_args: Vec<OsString>, + help: bool, +} + +fn parse_args() -> Result<Args, pico_ar...
2
42
0
621119e0f270cf2b6c1b934eef64c3e2cb07a525
Joshua Nelson
2020-11-24T14:15:10
Fix broken link in documentation
diff --git a/src/lib.rs b/src/lib.rs index aa9b316..22b60a0 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -587,7 +587,7 @@ impl Arguments { /// - When argument is not a UTF-8 string. Use [`free_from_os_str`] instead. /// - When value parsing failed. /// - /// [`value_from_os_str`]: struct.Arguments.html...
1
1
1
cfc40e4766f8b492df7da7a223f0568bb999c6db
Oleksiy Slyshyk
2020-10-27T17:57:57
Allow negative numbers in free args.
diff --git a/src/lib.rs b/src/lib.rs index 6856d08..aa9b316 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -690,10 +690,11 @@ impl Arguments { fn check_for_flags(&self) -> Result<(), Error> { // Check that there are no flags left. // But allow `-` which is used to indicate stdin. + // Also al...
2
14
1
7369cc80dde0718d9f4031d4deda1913dbac126e
Evgeniy Reizner
2020-06-26T11:34:25
Improve documentation.
diff --git a/src/lib.rs b/src/lib.rs index 20dba37..e24e509 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -151,9 +151,11 @@ impl Arguments { Arguments(args) } - /// Creates a parser from `env::args()`. + /// Creates a parser from [`env::args`]. /// /// The executable path will be removed. ...
1
30
11
297765a9fa65bcd7f1c2ef4560410c531d588b46
Evgeniy Reizner
2020-06-23T08:39:15
Update docs.
diff --git a/src/lib.rs b/src/lib.rs index 5639498..1a5f973 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -209,6 +209,11 @@ impl Arguments { /// Parses a key-value pair using a specified function. /// + /// When a key-value pair is separated by a space, the algorithm + /// will threat the next argument ...
1
5
0
9a32ce6290d086f0989151c986db0032b975d3f6
Evgeniy Reizner
2020-06-23T07:43:52
Revert "Reduce source code duplication" This reverts commit 22742836691d63a9a5131dd7eeba6e326ea619e6.
diff --git a/src/lib.rs b/src/lib.rs index 14d58bd..5639498 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -284,6 +284,7 @@ impl Arguments { } // The whole logic must be type-independent to prevent monomorphization. + #[cfg(feature = "eq-separator")] #[inline(never)] fn find_value( &mut s...
1
28
6
22742836691d63a9a5131dd7eeba6e326ea619e6
Aleksey Kladov
2020-06-23T07:33:58
Reduce source code duplication
diff --git a/src/lib.rs b/src/lib.rs index 5639498..14d58bd 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -284,7 +284,6 @@ impl Arguments { } // The whole logic must be type-independent to prevent monomorphization. - #[cfg(feature = "eq-separator")] #[inline(never)] fn find_value( &mut s...
1
6
28
73eb2098180c460e24eeb575efc545bdc8efcf84
Evgeniy Reizner
2020-02-20T01:18:57
Ignore debug related tests in release mode. Closes #9
diff --git a/tests/tests.rs b/tests/tests.rs index 3ce6964..bc40043 100644 --- a/tests/tests.rs +++ b/tests/tests.rs @@ -49,6 +49,7 @@ fn invalid_flag_01() { assert!(args.contains("v")); } +#[cfg(debug_assertions)] #[test] #[should_panic] fn invalid_flag_02() { @@ -56,6 +57,7 @@ fn invalid_flag_02() { a...
1
3
0
45b7220916b6f0f7ffa3bc3c6bd89851353cf92d
Aleksey Kladov
2020-01-08T07:45:05
Add support for subcommands
diff --git a/src/lib.rs b/src/lib.rs index 165487b..08ea0c1 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,7 +1,7 @@ /*! An ultra simple CLI arguments parser. -- Only flags, options and free arguments are supported. +- Only flags, options, free arguments and subcommands are supported. - Arguments can be separated ...
2
33
1
6b5dca5c893683475c2e085fe41d602361b6664c
Evgeniy Reizner
2019-07-26T12:12:55
Fix key-value args parsing.
diff --git a/src/lib.rs b/src/lib.rs index 4fba1b3..ecd5041 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -354,13 +354,13 @@ impl Arguments { // Loop unroll to save space. if !keys.first().is_empty() { - if let Some(i) = self.0.iter().position(|v| os_starts_with(v, keys.first())) { + ...
2
19
8
af45fed688318dc906e5069e54854f8cdbfd8880
Evgeniy Reizner
2019-07-26T12:01:58
Fix clap test up.
diff --git a/test-apps/clap-app/app.rs b/test-apps/clap-app/app.rs index e7524f6..528c258 100644 --- a/test-apps/clap-app/app.rs +++ b/test-apps/clap-app/app.rs @@ -39,13 +39,17 @@ fn main() { .index(1)) .get_matches(); - let args = AppArgs { + let mut args = AppArgs { help: match...
1
6
2
ca6d35f3fa41b4f83d2a8a6ac20b7bc705fdb048
Evgeniy Reizner
2019-07-23T18:51:52
Allow keys with non-static lifetimes. Closes #4
diff --git a/src/lib.rs b/src/lib.rs index 0fec77a..8890df7 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -63,8 +63,8 @@ There are a lot of arguments parsing implementations, but we will use only these | | `pico-args` | `clap` | `gumdrop` | `structopt` | |-------------------|-------------|--------...
1
28
28
0b358a62f68a05b247bcdf4b569968a0b23fefbd
Evgeniy Reizner
2019-07-23T13:11:53
Note about the arguments order.
diff --git a/src/lib.rs b/src/lib.rs index 9d3ed20..9d7da63 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -5,6 +5,7 @@ An ultra simple CLI arguments parser. - Arguments can be separated by a space or `=`. - No help generation. - No combined flags (like `-vvv` or `-abc`). +- Arguments are parsed in a linear order. From...
1
1
0
26e46d61d1e84ea898a49caf1702523415ed42c6
Evgeniy Reizner
2019-07-23T12:44:30
Test for duplicated options.
diff --git a/tests/tests.rs b/tests/tests.rs index 384e27c..7972724 100644 --- a/tests/tests.rs +++ b/tests/tests.rs @@ -160,6 +160,15 @@ fn eq_option_err_06() { "the '-w' option doesn't have an associated value"); } +#[test] +fn duplicated_options_01() { + let mut args = Arguments::from_vec(to_ve...
1
9
0
95a341b19cad9e9df7c48dc39fdeef28bfed5fc9
Evgeniy Reizner
2019-07-22T20:37:07
Move test apps to a separate dir.
diff --git a/Cargo.toml b/Cargo.toml index 842b5fe..800ea98 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,3 +9,4 @@ description = "An ultra simple CLI arguments parser." repository = "https://github.com/RazrFalcon/pico-args" documentation = "https://docs.rs/pico-args/" readme = "README.md" +exclude = ["test-apps/**...
11
41
1
666785d1ffc79f1cae42079dd40c72a674a0e719
Evgeniy Reizner
2019-07-21T18:27:11
Allow --key=value.
diff --git a/examples/null-app/Cargo.toml b/examples/null-app/Cargo.toml new file mode 100644 index 0000000..bdea5d8 --- /dev/null +++ b/examples/null-app/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "null-app" +version = "0.1.0" +authors = ["Evgeniy Reizner <razrfalcon@gmail.com>"] +edition = "2018" + +[[bin]] +name ...
4
172
8
26e63cd964a2e364331a5dd977d589bb9f649d8c
Peter Glotfelty
2026-02-22T06:46:37
Display exists in core (#477) Co-authored-by: Peternator7 <peter@glotfelty.us>
diff --git a/strum/src/lib.rs b/strum/src/lib.rs index 073e0c1..ddbe796 100644 --- a/strum/src/lib.rs +++ b/strum/src/lib.rs @@ -43,9 +43,8 @@ pub enum ParseError { VariantNotFound, } -#[cfg(feature = "std")] -impl std::fmt::Display for ParseError { - fn fmt(&self, f: &mut std::fmt::Formatter) -> Result<(), ...
1
2
3
9334c728eedaa8a992d1388a8f4564bbccad1934
Peter Glotfelty
2026-02-22T06:28:38
Make TryFrom and FromStr infallible if there's a default (#476)
diff --git a/strum_macros/src/lib.rs b/strum_macros/src/lib.rs index 93d7fc9..d2642e3 100644 --- a/strum_macros/src/lib.rs +++ b/strum_macros/src/lib.rs @@ -34,15 +34,15 @@ fn debug_print_generated(ast: &DeriveInput, toks: &TokenStream) { /// Converts strings to enum variants based on their name. /// -/// auto-deri...
5
182
88
0ccbbf823c16e827afc263182cd55e99e3b2a52e
Ryan Johnson
2026-02-21T20:25:01
Honor parse_err_ty attribute when the enum has a default variant (#431) * Honor parse_err_ty attribute when the enum has a default variant * fix confusing variable name
diff --git a/strum_macros/src/lib.rs b/strum_macros/src/lib.rs index 34391c3..93d7fc9 100644 --- a/strum_macros/src/lib.rs +++ b/strum_macros/src/lib.rs @@ -58,11 +58,15 @@ fn debug_print_generated(ast: &DeriveInput, toks: &TokenStream) { /// can be very fast for enums with a surprisingly large number of enum variants...
3
38
9
2c9e5a9259189ce8397f2f4967060240c6bafd74
Peter Glotfelty
2026-02-21T17:31:55
Automatically add Default implementation to EnumDiscriminant if it exists on the base Enum (#474) Co-authored-by: Peternator7 <peter@glotfelty.us>
diff --git a/strum_macros/src/macros/enum_discriminants.rs b/strum_macros/src/macros/enum_discriminants.rs index a5c7d99..e6a9378 100644 --- a/strum_macros/src/macros/enum_discriminants.rs +++ b/strum_macros/src/macros/enum_discriminants.rs @@ -24,7 +24,80 @@ pub fn enum_discriminants_inner(ast: &DeriveInput) -> syn::R...
2
95
50
639b67fefd20eaead1c5d2ea794e9afe70a00312
Charles Lechasseur
2026-02-05T17:05:39
feat: allow any kind of passthrough attributes on `EnumDiscriminants` (#461) Port of https://github.com/clechasseur/gratte/pull/15
diff --git a/strum_macros/src/helpers/metadata.rs b/strum_macros/src/helpers/metadata.rs index 056a4d8..62262e1 100644 --- a/strum_macros/src/helpers/metadata.rs +++ b/strum_macros/src/helpers/metadata.rs @@ -1,4 +1,3 @@ -use proc_macro2::TokenStream; use syn::{ parenthesized, parse::{Parse, ParseStream}, @@...
5
71
33
0ea1e2d0fd1460e7492ea32e6b460394d9199ff8
Jagoda Estera Ślązak
2026-01-25T00:55:04
docs: Fix typo (#463)
diff --git a/strum/src/additional_attributes.rs b/strum/src/additional_attributes.rs index b640ba4..a999507 100644 --- a/strum/src/additional_attributes.rs +++ b/strum/src/additional_attributes.rs @@ -61,7 +61,7 @@ //! this specifies what text to use when calling `variant.to_string()` with the `Display` derivation,...
1
1
1
36c051b91086b37d531c63ccf5a49266832a846d
Paolo Barbolini
2026-01-25T00:54:26
Upgrade `phf` to v0.13 (#465)
diff --git a/strum/Cargo.toml b/strum/Cargo.toml index ac11644..dbc2728 100644 --- a/strum/Cargo.toml +++ b/strum/Cargo.toml @@ -17,7 +17,7 @@ rust-version = "1.71" [dependencies] strum_macros = { path = "../strum_macros", optional = true, version = "0.27" } -phf = { version = "0.12", features = ["macros"], optiona...
1
1
1
9328b38617dc6f4a3bc5fdac03883d3fc766cf34
Snarpix
2026-01-25T00:41:01
Use absolute paths in proc macro (#469)
diff --git a/strum_macros/src/macros/enum_iter.rs b/strum_macros/src/macros/enum_iter.rs index 4142024..0d593a9 100644 --- a/strum_macros/src/macros/enum_iter.rs +++ b/strum_macros/src/macros/enum_iter.rs @@ -115,7 +115,7 @@ pub fn enum_iter_inner(ast: &DeriveInput) -> syn::Result<TokenStream> { } #...
1
5
5
1f974f28a2c1a545ccababd368882b27acf152ae
Charles Lechasseur
2026-01-25T00:33:25
feat: add missing `#[automatically_derived]` (#462) Ported from https://github.com/clechasseur/gratte/pull/24
diff --git a/strum_macros/src/macros/enum_table.rs b/strum_macros/src/macros/enum_table.rs index 8e61a10..29c32b4 100644 --- a/strum_macros/src/macros/enum_table.rs +++ b/strum_macros/src/macros/enum_table.rs @@ -122,6 +122,7 @@ pub fn enum_table_inner(ast: &DeriveInput) -> syn::Result<TokenStream> { #(#sn...
4
11
0
38f66210e7ca0bb156f3632dcf24a2548959c379
Peter Glotfelty
2025-06-30T00:03:22
Expound upon use_phf docs (#449) Co-authored-by: Peter Glotfelty <peter@glotfelty.us>
diff --git a/strum_macros/src/lib.rs b/strum_macros/src/lib.rs index 7b6aaf5..7f16dfe 100644 --- a/strum_macros/src/lib.rs +++ b/strum_macros/src/lib.rs @@ -51,8 +51,11 @@ fn debug_print_generated(ast: &DeriveInput, toks: &TokenStream) { /// See the [Additional Attributes](https://docs.rs/strum/latest/strum/additional...
1
5
2
bb1339026b44773e395913340f4e60972fa5e6a1
Amogh Dambal
2025-06-29T23:58:29
Implement a `suffix` attribute for serialization of enum variants (#440) * test: add default test for prefix kw * feat: implement suffix enum attribute similarly to the `prefix` attribute, implement a corresponding attribute that suffixes enum variants. issue: fixes #392 * test: add tests for new suffix attribute...
diff --git a/strum_macros/src/helpers/metadata.rs b/strum_macros/src/helpers/metadata.rs index b572b31..056a4d8 100644 --- a/strum_macros/src/helpers/metadata.rs +++ b/strum_macros/src/helpers/metadata.rs @@ -19,6 +19,7 @@ pub mod kw { custom_keyword!(const_into_str); custom_keyword!(use_phf); custom_key...
13
183
18
c9e52bfd2865c8c766e0379f9e7bf57621a104e3
Dandelion Huang
2025-06-29T23:48:21
Add `#[automatically_derived]` to the `impl`s (#444) * feat(strum_macros): add `#[automatically_derived]` to `enum_*` * feat(strum_macros): add `#[automatically_derived]` to `from_repr` * feat(strum_macros): add `#[automatically_derived]` to string traits
diff --git a/strum_macros/src/macros/enum_count.rs b/strum_macros/src/macros/enum_count.rs index b9e6aaa..2284495 100644 --- a/strum_macros/src/macros/enum_count.rs +++ b/strum_macros/src/macros/enum_count.rs @@ -27,6 +27,7 @@ pub(crate) fn enum_count_inner(ast: &DeriveInput) -> syn::Result<TokenStream> { Ok(quo...
12
28
1
1b00f899e52f43fa35c4d406c901d33b1e9645e2
ClaytonKnittel
2025-06-29T23:47:02
Change enum table callbacks to FnMut. (#443)
diff --git a/strum_macros/src/macros/enum_table.rs b/strum_macros/src/macros/enum_table.rs index cfcf270..8e61a10 100644 --- a/strum_macros/src/macros/enum_table.rs +++ b/strum_macros/src/macros/enum_table.rs @@ -144,7 +144,7 @@ pub fn enum_table_inner(ast: &DeriveInput) -> syn::Result<TokenStream> { #[d...
1
2
2
95037811412792c9cd70586598aa88d7f514c0ac
crop
2025-06-29T23:42:59
allow discriminants on empty enum (#435)
diff --git a/strum_macros/src/macros/enum_discriminants.rs b/strum_macros/src/macros/enum_discriminants.rs index 2f840bb..3f0ca80 100644 --- a/strum_macros/src/macros/enum_discriminants.rs +++ b/strum_macros/src/macros/enum_discriminants.rs @@ -136,7 +136,12 @@ pub fn enum_discriminants_inner(ast: &DeriveInput) -> syn:...
2
20
1
8553ba2845989337d88a7170f7f0c419945bf156
Paolo Barbolini
2025-06-29T23:38:30
Upgrade `phf` to v0.12 (#448)
diff --git a/strum/Cargo.toml b/strum/Cargo.toml index 2fe217c..54a2db5 100644 --- a/strum/Cargo.toml +++ b/strum/Cargo.toml @@ -17,7 +17,7 @@ rust-version = "1.66.1" [dependencies] strum_macros = { path = "../strum_macros", optional = true, version = "0.27.1" } -phf = { version = "0.11", features = ["macros"], opt...
1
1
1
2eba5c2a5c0b827317bafcb1f545af67b5ce9110
Paolo Barbolini
2025-06-29T23:35:35
Drop needless `rustversion` dependency (#446) lgtm 👍
diff --git a/strum_macros/Cargo.toml b/strum_macros/Cargo.toml index 06f73ab..2a6a64b 100644 --- a/strum_macros/Cargo.toml +++ b/strum_macros/Cargo.toml @@ -23,7 +23,6 @@ name = "strum_macros" heck = "0.5.0" proc-macro2 = "1.0" quote = "1.0" -rustversion = "1.0" syn = { version = "2.0", features = ["parsing"] } ...
10
2
76
1576a7ab599b5adffa82fb9234e561a7aeea5ed0
Peter Glotfelty
2025-02-17T00:23:15
Peternator7/fix transparent typo (#421) * Fix an incorrect refactor on the unifying of the "transparent" code * Support FromString properly as well * Play with references to make transparent work properly with &'static str. * Add a test case --------- Co-authored-by: Peter Glotfelty <peter@glotfelty.us>
diff --git a/strum/src/additional_attributes.rs b/strum/src/additional_attributes.rs index b77a62f..b640ba4 100644 --- a/strum/src/additional_attributes.rs +++ b/strum/src/additional_attributes.rs @@ -76,7 +76,9 @@ //! //! - `transparent`: Signals that the inner field's implementation should be used, instead of gener...
7
73
13
9c5fb56b4b6b7b0db43c9fa8e8a0621b544e209a
Peter Glotfelty
2025-02-16T23:19:57
Fix warnings in tests from variants that need to exist, but don't get used (#419) Co-authored-by: Peter Glotfelty <peter@glotfelty.us>
diff --git a/strum_macros/src/macros/strings/as_ref_str.rs b/strum_macros/src/macros/strings/as_ref_str.rs index f931a0b..4248171 100644 --- a/strum_macros/src/macros/strings/as_ref_str.rs +++ b/strum_macros/src/macros/strings/as_ref_str.rs @@ -93,7 +93,7 @@ pub fn as_static_str_inner( ) -> syn::Result<TokenStream> { ...
5
17
7
7606dd598215e43a1dca004722b42816a60baa01
Peter Glotfelty
2025-02-16T20:01:24
Do some light refactoring to combine similiar code paths together
diff --git a/strum/src/additional_attributes.rs b/strum/src/additional_attributes.rs index 769824e..b77a62f 100644 --- a/strum/src/additional_attributes.rs +++ b/strum/src/additional_attributes.rs @@ -73,9 +73,9 @@ //! ``` //! The plugin will fail if the data doesn't implement From<&str>. You can only have on...
9
173
136
24e7a4fdddd769d4ed2c84de625b75d06b545b63
Peter Glotfelty
2025-02-16T18:47:46
Use _ to silence warnings (#418) Co-authored-by: Peter Glotfelty <peter@glotfelty.us>
diff --git a/strum_macros/src/helpers/metadata.rs b/strum_macros/src/helpers/metadata.rs index 9863d67..2b9a94a 100644 --- a/strum_macros/src/helpers/metadata.rs +++ b/strum_macros/src/helpers/metadata.rs @@ -111,7 +111,7 @@ impl Parse for EnumMeta { } pub enum EnumDiscriminantsMeta { - Derive { kw: kw::derive, ...
1
9
9
4c1f6c1015d336f9732ea2f5aa96f21020ae2d4b
Peter Glotfelty
2025-02-15T20:43:30
Update docs to actually include new features (#417) Co-authored-by: Peter Glotfelty <peter@glotfelty.us>
diff --git a/strum_macros/src/lib.rs b/strum_macros/src/lib.rs index 689db17..830ad47 100644 --- a/strum_macros/src/lib.rs +++ b/strum_macros/src/lib.rs @@ -54,6 +54,12 @@ fn debug_print_generated(ast: &DeriveInput, toks: &TokenStream) { /// If you have a large enum, you may want to consider using the `use_phf` attrib...
1
6
0
9db3c4dc9b6f585aeb9f5f15f9cc18b6cf4fd780
tveness
2025-02-15T02:25:43
Replace IntoDiscriminant with EnumDiscriminants in macro exports, as (#414) EnumDiscriminants is the actual macro
diff --git a/strum/src/lib.rs b/strum/src/lib.rs index 797ea98..073e0c1 100644 --- a/strum/src/lib.rs +++ b/strum/src/lib.rs @@ -253,7 +253,7 @@ DocumentMacroRexports! { AsRefStr, Display, EnumCount, - IntoDiscriminant, + EnumDiscriminants, EnumIter, EnumMessage, EnumProperty,
1
1
1
f684dc446dba26653065c9896d77c4312ae95b7e
Peter Glotfelty
2025-02-08T22:35:09
Per cargo docs, this should fix the circular dep when publishing strum (#411) Co-authored-by: Peter Glotfelty <peter@glotfelty.us>
diff --git a/strum_macros/Cargo.toml b/strum_macros/Cargo.toml index f76a994..f3635cf 100644 --- a/strum_macros/Cargo.toml +++ b/strum_macros/Cargo.toml @@ -27,4 +27,4 @@ rustversion = "1.0" syn = { version = "2.0", features = ["parsing"] } [dev-dependencies] -strum = { path = "../strum", version= "0.26" } +strum =...
1
1
1
45323f712fd6773a0f4ce78393fa7b0f9ff4d544
Peter Glotfelty
2025-02-08T19:54:57
Use a "Path" instead of "String" for FromStr's error methods (#410) Co-authored-by: Peter Glotfelty <peter@glotfelty.us>
diff --git a/strum_macros/src/helpers/metadata.rs b/strum_macros/src/helpers/metadata.rs index 4c333e4..9863d67 100644 --- a/strum_macros/src/helpers/metadata.rs +++ b/strum_macros/src/helpers/metadata.rs @@ -95,16 +95,12 @@ impl Parse for EnumMeta { } else if lookahead.peek(kw::parse_err_ty) { le...
2
4
8
b08ca819c4f726c0cbde3957586848aece1145b6
Peter Glotfelty
2025-02-08T15:42:55
Fix potential errors from vis diffs (#409) Co-authored-by: Peter Glotfelty <peter@glotfelty.us>
diff --git a/strum_macros/src/macros/enum_discriminants.rs b/strum_macros/src/macros/enum_discriminants.rs index b57fa3b..8dc4aaa 100644 --- a/strum_macros/src/macros/enum_discriminants.rs +++ b/strum_macros/src/macros/enum_discriminants.rs @@ -36,7 +36,8 @@ pub fn enum_discriminants_inner(ast: &DeriveInput) -> syn::Re...
1
23
10
b7c31f555786b95bb897ea5c6936eaeacc931fa8
Dániel Buga
2025-02-08T02:16:44
Fix Display macro in no_std apps (#407)
diff --git a/strum_macros/src/macros/strings/display.rs b/strum_macros/src/macros/strings/display.rs index 5e7a422..132e335 100644 --- a/strum_macros/src/macros/strings/display.rs +++ b/strum_macros/src/macros/strings/display.rs @@ -94,7 +94,7 @@ pub fn display_inner(ast: &DeriveInput) -> syn::Result<TokenStream> { ...
1
1
1
043dc127463138f230e6a0326634c82bccd5a5e8
Vladislav Sukhmel
2025-02-08T02:15:02
Use asserts instead of println in Display docstrings (#403) * Use asserts instead of println in Display docstring To better convey the results and make sure the user expectations are set right, use `assert_eq` + `format` instead of `println` that is not very informative without specifying what should be printed. ...
diff --git a/strum_macros/src/lib.rs b/strum_macros/src/lib.rs index 108654b..689db17 100644 --- a/strum_macros/src/lib.rs +++ b/strum_macros/src/lib.rs @@ -154,10 +154,13 @@ pub fn from_string(input: proc_macro::TokenStream) -> proc_macro::TokenStream { /// let yellow = Color::Yellow; /// assert_eq!("Yellow", yellow...
1
14
8
46cf82b69a9b462bd16c10f22328145af48dc278
Peter Glotfelty
2025-02-08T02:11:29
Using fn() -> T instead of T in the phantom data will make all EnumIterator types Send + Sync. (#402) 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 9df3c66..6145bf9 100644 --- a/strum_macros/src/macros/enum_iter.rs +++ b/strum_macros/src/macros/enum_iter.rs @@ -23,9 +23,9 @@ pub fn enum_iter_inner(ast: &DeriveInput) -> syn::Result<TokenStream> { let phantom_data =...
1
2
2
8903ea052f70f67914864598a6f03beec0766e3b
Joel Natividad
2025-01-12T22:28:20
deps: bumped phf to 0.11 (#401)
diff --git a/strum/Cargo.toml b/strum/Cargo.toml index 2152d63..cb1c8b5 100644 --- a/strum/Cargo.toml +++ b/strum/Cargo.toml @@ -16,7 +16,7 @@ readme = "../README.md" [dependencies] strum_macros = { path = "../strum_macros", optional = true, version = "0.26.3" } -phf = { version = "0.10", features = ["macros"], opt...
1
1
1
1659717e0a496841043648a89df86846c1bbff0a
Pierre-Henri Symoneaux
2025-01-03T09:57:38
fix EnumTryAs to allow attributes on enum variant fields Closes #399 Signed-off-by: Pierre-Henri Symoneaux <pierre-henri.symoneaux@ovhcloud.com>
diff --git a/strum_macros/src/macros/enum_try_as.rs b/strum_macros/src/macros/enum_try_as.rs index c6d0127..470d80a 100644 --- a/strum_macros/src/macros/enum_try_as.rs +++ b/strum_macros/src/macros/enum_try_as.rs @@ -23,7 +23,7 @@ pub fn enum_try_as_inner(ast: &DeriveInput) -> syn::Result<TokenStream> { ...
2
8
1
73ef6bfe66535554bfe9d9cb101cc1ff041b9060
MHS-0
2025-01-01T09:06:46
Upgrade dependencies to the latest possible version where possible enum_variant_type wasn't upgraded as it will stop us from making sure that ::core is used in macros
diff --git a/Cargo.toml b/Cargo.toml index 094b6e6..bbd6c9e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,4 +5,4 @@ members = [ "strum_tests", "strum_nostd_tests" ] - \ No newline at end of file +resolver = "2" diff --git a/strum/Cargo.toml b/strum/Cargo.toml index 2152d63..c53dc83 100644 --- a/strum/Cargo...
7
22
20
3408033e9aee44d7c57eef5d3bd414cb48b8f24d
Martin Liška
2024-12-15T23:25:39
Implement `get_int`/`get_bool` for properties (#391) * Implement get_bool/get_int for properies * Reimplement using HashMap * Document new methods in EnumProperty section
diff --git a/strum/src/lib.rs b/strum/src/lib.rs index 90f2d75..2a6d44c 100644 --- a/strum/src/lib.rs +++ b/strum/src/lib.rs @@ -155,9 +155,8 @@ pub trait EnumMessage { /// `EnumProperty` is a trait that makes it possible to store additional information /// with enum variants. This trait is designed to be used with...
5
109
34
49e1af5b6d06188327a9972dbfdaae68421a299e
Jim Chen
2024-12-15T22:59:23
fix typo (#393)
diff --git a/strum_macros/src/helpers/mod.rs b/strum_macros/src/helpers/mod.rs index a00e8e4..5d37ea6 100644 --- a/strum_macros/src/helpers/mod.rs +++ b/strum_macros/src/helpers/mod.rs @@ -16,7 +16,7 @@ use syn::spanned::Spanned; pub fn missing_parse_err_attr_error() -> syn::Error { syn::Error::new( Span...
1
1
1
b03e1a0a24aaa6c791a387c3b22908f41911c18d
Jim Chen
2024-11-25T01:06:43
feat: FromStr derive could support setting the error type (#380) * feat: FromStr derive could support setting the error type ref #91 * chore: adjust unit test --------- Co-authored-by: Peter Glotfelty <glotfelty.2@osu.edu>
diff --git a/strum_macros/src/helpers/metadata.rs b/strum_macros/src/helpers/metadata.rs index 5a44c78..f53d99b 100644 --- a/strum_macros/src/helpers/metadata.rs +++ b/strum_macros/src/helpers/metadata.rs @@ -18,6 +18,8 @@ pub mod kw { custom_keyword!(serialize_all); custom_keyword!(use_phf); custom_keyw...
5
111
10
e42916aa4716d1c9287b624fd19abd40a6e46bf6
marc0246
2024-11-17T20:27:39
Inline generated functions (#389)
diff --git a/strum_macros/src/macros/enum_discriminants.rs b/strum_macros/src/macros/enum_discriminants.rs index aee4bc6..b57fa3b 100644 --- a/strum_macros/src/macros/enum_discriminants.rs +++ b/strum_macros/src/macros/enum_discriminants.rs @@ -133,6 +133,7 @@ pub fn enum_discriminants_inner(ast: &DeriveInput) -> syn::...
8
32
0
3479cbb47ca80d2100b62d9a85ba4809a6eb0a63
Vincent Ging Ho Yim
2024-11-17T20:22:02
docs(strum_macros): fix typo in `enum_iter` docs (#387)
diff --git a/strum_macros/src/lib.rs b/strum_macros/src/lib.rs index 0e93b8a..5954ca1 100644 --- a/strum_macros/src/lib.rs +++ b/strum_macros/src/lib.rs @@ -429,7 +429,7 @@ pub fn display(input: proc_macro::TokenStream) -> proc_macro::TokenStream { toks.into() } -/// Creates a new type that iterates of the vari...
1
1
1
9710f41a3aa08eb30f9e957c8f84d7a2aab9f050
Jonas Platte
2024-09-29T21:39:54
macros: Stop using syn's extra-traits feature (#378) … to reduce compile times.
diff --git a/strum_macros/Cargo.toml b/strum_macros/Cargo.toml index c053ac2..243d723 100644 --- a/strum_macros/Cargo.toml +++ b/strum_macros/Cargo.toml @@ -23,7 +23,7 @@ heck = "0.5.0" proc-macro2 = "1.0" quote = "1.0" rustversion = "1.0" -syn = { version = "2.0", features = ["parsing", "extra-traits"] } +syn = { v...
6
5
6
1454cede2f242801d7e40dbf2fde15dbb144db18
vpochapuis
2024-09-29T21:33:54
Add EnumDiscriminants Trait and related Macro impl (#377) * Add EnumDiscriminants Trait and related Macro impl * Apply related suggestions from Maintainer: add trait method and rename trait --------- Co-authored-by: vchapuis <vincent.chapuis@fortune.com.tw>
diff --git a/strum/src/lib.rs b/strum/src/lib.rs index 3b5af9c..90f2d75 100644 --- a/strum/src/lib.rs +++ b/strum/src/lib.rs @@ -217,6 +217,15 @@ pub trait VariantNames { const VARIANTS: &'static [&'static str]; } +/// A trait for retrieving the enum generated by [`EnumDiscriminants`] from an associated +/// Ty...
2
19
1
43ab91a0ae96cee8cad41e1c8440de8725a82d94
max143672
2024-08-02T10:40:04
fix: remove dereference
diff --git a/strum_macros/src/macros/strings/as_ref_str.rs b/strum_macros/src/macros/strings/as_ref_str.rs index 6f90f1a..eb535df 100644 --- a/strum_macros/src/macros/strings/as_ref_str.rs +++ b/strum_macros/src/macros/strings/as_ref_str.rs @@ -118,7 +118,7 @@ pub fn as_static_str_inner( GenerateTraitVariant::...
1
1
1
6b09049034cd4190f7cba799720e5f611c0ae5cf
Ran Miller
2024-07-27T21:53:28
docs(strum_macros): fix word error in doc (#370)
diff --git a/strum_macros/src/lib.rs b/strum_macros/src/lib.rs index 38e81f2..0e93b8a 100644 --- a/strum_macros/src/lib.rs +++ b/strum_macros/src/lib.rs @@ -54,7 +54,7 @@ fn debug_print_generated(ast: &DeriveInput, toks: &TokenStream) { /// If you have a large enum, you may want to consider using the `use_phf` attribu...
1
1
1
b233ecf1e6c2486690d3e6b8f8fa2c61db02317b
Josh McKinney
2024-06-23T22:34:20
fix: require strum_macros 0.26.3 (#365) This is required for compatibility with itertools 0.13.0 fixed in #358 Fixes: https://github.com/Peternator7/strum/issues/364
diff --git a/strum/Cargo.toml b/strum/Cargo.toml index 2febfa4..ee54b3d 100644 --- a/strum/Cargo.toml +++ b/strum/Cargo.toml @@ -15,7 +15,7 @@ repository = "https://github.com/Peternator7/strum" readme = "../README.md" [dependencies] -strum_macros = { path = "../strum_macros", optional = true, version = "0.26" } +s...
1
1
1
a663c60f2b66e8d47d24aa89ae4d79407ac22118
Peter Glotfelty
2024-06-05T03:56:16
Fix the unconditional usage of string interpolation in strum (#360) 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 650e5b2..5e7a422 100644 --- a/strum_macros/src/macros/strings/display.rs +++ b/strum_macros/src/macros/strings/display.rs @@ -124,7 +124,17 @@ pub fn display_inner(ast: &DeriveInput) -> syn::Result<TokenStream> { ...
2
12
2
0c85c16e12e80dd49e75117e7c94f697d0ad06d0
bluurryy
2024-06-01T22:01:56
Use associated function syntax for calling `get` on an `EnumIter`, eliminating ambiguities. (#357)
diff --git a/strum_macros/src/macros/enum_iter.rs b/strum_macros/src/macros/enum_iter.rs index 5e81001..f8a2070 100644 --- a/strum_macros/src/macros/enum_iter.rs +++ b/strum_macros/src/macros/enum_iter.rs @@ -131,7 +131,7 @@ pub fn enum_iter_inner(ast: &DeriveInput) -> syn::Result<TokenStream> { ::...
1
2
2
c37398ba81b46d022929b9b992a95e83c32dbe52
max143672
2024-05-13T08:07:36
fix: fix const into str implementation, add test cases
diff --git a/strum_macros/src/macros/strings/as_ref_str.rs b/strum_macros/src/macros/strings/as_ref_str.rs index e229e00..6f90f1a 100644 --- a/strum_macros/src/macros/strings/as_ref_str.rs +++ b/strum_macros/src/macros/strings/as_ref_str.rs @@ -116,8 +116,8 @@ pub fn as_static_str_inner( } }, ...
2
76
2
9689d7bb55bad0269c3fc9679a7434670139b12b
lolbinarycat
2024-05-12T22:43:51
add hyperlinks to documentation and clarify derive macros (#355) this makes it easier to navigate the documentation. one comment seemed to suggest that the reexport of the derive macros was depricated, however that has been ignored for several reasons: 1. exposing macros through a derive feature flag is common...
diff --git a/strum/src/lib.rs b/strum/src/lib.rs index 65c2e55..3b5af9c 100644 --- a/strum/src/lib.rs +++ b/strum/src/lib.rs @@ -67,7 +67,7 @@ impl std::error::Error for ParseError { } /// This trait designates that an `Enum` can be iterated over. It can -/// be auto generated using `strum_macros` on your behalf. +...
2
6
2
186d29f6a1691b6356a2d85d66f8904b9a5d3140
gin-ahirsch
2024-05-05T01:02:46
Interpolate unnamed enum variant fields in to_string attribute (#345) * Trim spaces at the end of format capture identifiers format! allows trailing spaces. * Interpolate unnamed enum variant fields in to_string attribute * Reject "{}" in unit-variants in enums Strings for unit-variants in enums were taken...
diff --git a/strum_macros/src/lib.rs b/strum_macros/src/lib.rs index 089dfc1..f9282b2 100644 --- a/strum_macros/src/lib.rs +++ b/strum_macros/src/lib.rs @@ -367,7 +367,7 @@ pub fn to_string(input: proc_macro::TokenStream) -> proc_macro::TokenStream { /// 3. The name of the variant will be used if there are no `seriali...
3
93
36
07804d02af643f06831fabecc79ceb3560e73bb8
max143672
2024-04-26T12:40:01
Add support for `const_into_str` attribute to enable static string conversions in const contexts resolves: #352
diff --git a/strum_macros/src/helpers/metadata.rs b/strum_macros/src/helpers/metadata.rs index 94100a7..384debf 100644 --- a/strum_macros/src/helpers/metadata.rs +++ b/strum_macros/src/helpers/metadata.rs @@ -16,6 +16,7 @@ pub mod kw { // enum metadata custom_keyword!(serialize_all); + custom_keyword!(co...
3
38
1