Commit Graph

4076 Commits

Author SHA1 Message Date
f5700b61ad
Fix missing desrialize for FileOpenMode
Some checks failed
CI / Test suite (push) Has been cancelled
CI / Test suite (windows) (push) Has been cancelled
CI / Rust ${{matrix.rust}} (beta) (push) Has been cancelled
CI / Rust ${{matrix.rust}} (stable) (push) Has been cancelled
CI / Rust nightly ${{matrix.os == 'windows' && '(windows)' || ''}} (ubuntu) (push) Has been cancelled
CI / Rust nightly ${{matrix.os == 'windows' && '(windows)' || ''}} (windows) (push) Has been cancelled
CI / Rust ${{matrix.rust}} (1.31.0) (push) Has been cancelled
CI / Rust ${{matrix.rust}} (1.34.0) (push) Has been cancelled
CI / Rust 1.56.0 (push) Has been cancelled
CI / Rust 1.36.0 (push) Has been cancelled
CI / Minimal versions (push) Has been cancelled
CI / Documentation (push) Has been cancelled
CI / Clippy (push) Has been cancelled
CI / Miri (push) Has been cancelled
CI / Outdated (push) Has been cancelled
2024-11-16 11:50:22 -06:00
678d2be06c
Add ser/de impls for mikros File(Creation/Write/Open)Mode
Some checks failed
CI / Test suite (push) Has been cancelled
CI / Test suite (windows) (push) Has been cancelled
CI / Rust ${{matrix.rust}} (beta) (push) Has been cancelled
CI / Rust ${{matrix.rust}} (stable) (push) Has been cancelled
CI / Rust nightly ${{matrix.os == 'windows' && '(windows)' || ''}} (ubuntu) (push) Has been cancelled
CI / Rust nightly ${{matrix.os == 'windows' && '(windows)' || ''}} (windows) (push) Has been cancelled
CI / Rust ${{matrix.rust}} (1.31.0) (push) Has been cancelled
CI / Rust ${{matrix.rust}} (1.34.0) (push) Has been cancelled
CI / Rust 1.56.0 (push) Has been cancelled
CI / Rust 1.36.0 (push) Has been cancelled
CI / Minimal versions (push) Has been cancelled
CI / Documentation (push) Has been cancelled
CI / Clippy (push) Has been cancelled
CI / Miri (push) Has been cancelled
CI / Outdated (push) Has been cancelled
2024-11-11 15:48:33 -06:00
1b40077a58
Fix Serialize/Deserialize for std::os::mikros::Errno
Some checks failed
CI / Test suite (push) Has been cancelled
CI / Test suite (windows) (push) Has been cancelled
CI / Rust ${{matrix.rust}} (beta) (push) Has been cancelled
CI / Rust ${{matrix.rust}} (stable) (push) Has been cancelled
CI / Rust nightly ${{matrix.os == 'windows' && '(windows)' || ''}} (ubuntu) (push) Has been cancelled
CI / Rust nightly ${{matrix.os == 'windows' && '(windows)' || ''}} (windows) (push) Has been cancelled
CI / Rust ${{matrix.rust}} (1.31.0) (push) Has been cancelled
CI / Rust ${{matrix.rust}} (1.34.0) (push) Has been cancelled
CI / Rust 1.56.0 (push) Has been cancelled
CI / Rust 1.36.0 (push) Has been cancelled
CI / Minimal versions (push) Has been cancelled
CI / Documentation (push) Has been cancelled
CI / Clippy (push) Has been cancelled
CI / Miri (push) Has been cancelled
CI / Outdated (push) Has been cancelled
2024-10-04 12:33:07 -05:00
7b4c40c037
Add Serialize/Deserialize for std::os::mikros::Errno
Some checks are pending
CI / Test suite (push) Waiting to run
CI / Test suite (windows) (push) Waiting to run
CI / Rust ${{matrix.rust}} (beta) (push) Waiting to run
CI / Rust ${{matrix.rust}} (stable) (push) Waiting to run
CI / Rust nightly ${{matrix.os == 'windows' && '(windows)' || ''}} (ubuntu) (push) Waiting to run
CI / Rust nightly ${{matrix.os == 'windows' && '(windows)' || ''}} (windows) (push) Waiting to run
CI / Rust ${{matrix.rust}} (1.31.0) (push) Waiting to run
CI / Rust ${{matrix.rust}} (1.34.0) (push) Waiting to run
CI / Rust 1.56.0 (push) Waiting to run
CI / Rust 1.36.0 (push) Waiting to run
CI / Minimal versions (push) Waiting to run
CI / Documentation (push) Waiting to run
CI / Clippy (push) Waiting to run
CI / Miri (push) Waiting to run
CI / Outdated (push) Waiting to run
2024-10-03 17:59:17 -05:00
David Tolnay
31000e1874
Add a funding file 2024-09-23 15:38:18 -07:00
David Tolnay
4487cb26c7
Merge pull request #2822 from dtolnay/mapcontentdeserializer
Remove explicit ContentDeserializer construction in visit functions
2024-09-07 16:41:38 -07:00
David Tolnay
aba4e18553
Remove explicit ContentDeserializer construction in visit functions 2024-09-07 16:31:03 -07:00
David Tolnay
c82f2580b4
Merge pull request #2821 from dtolnay/clos
Eliminate closures capturing needlessly many type parameters
2024-09-06 16:54:36 -07:00
David Tolnay
1d7b009aec
Eliminate closures capturing needlessly many type parameters 2024-09-06 16:29:41 -07:00
David Tolnay
89c4b02bf3
Release 1.0.210 2024-09-06 11:17:20 -07:00
David Tolnay
eeb8e44cda
Merge pull request #2818 from dtolnay/coreerror
Stabilize no-std Error trait
2024-09-06 11:16:43 -07:00
David Tolnay
785c2d9605
Stabilize no-std StdError trait 2024-09-06 11:12:13 -07:00
David Tolnay
d549f048e1
Reformat parse_ip_impl definition and calls 2024-09-06 11:05:54 -07:00
David Tolnay
4c0dd63011
Delete attr support from core::net deserialization macros 2024-09-06 11:05:54 -07:00
David Tolnay
26fb134165
Relocate cfg attrs out of parse_ip_impl and parse_socket_impl 2024-09-06 11:05:53 -07:00
David Tolnay
07e614b52b
Merge pull request #2817 from dtolnay/corenet
Delete doc(cfg) attribute from impls that are supported in no-std
2024-09-06 11:05:48 -07:00
David Tolnay
b1f899fbe8
Delete doc(cfg) attribute from impls that are supported in no-std 2024-09-06 11:00:55 -07:00
David Tolnay
b4f860e627
Merge pull request #2816 from MathiasKoch/chore/core-net
Implement serialize/deserialize for core::net instead of std::net
2024-09-06 10:59:24 -07:00
Mathias
d940fe1b49 Reuse existing Buf wrapper as replacement for std::io::Write 2024-09-05 14:24:44 +02:00
Mathias
f2899a9e06 Implement serialize/deserialize for core::net instead of std::net if running rust version newer than 1.77, where core::net was stabilized 2024-09-05 11:07:09 +02:00
David Tolnay
3aca38d2d3
Upload CI Cargo.lock for reproducing failures 2024-08-25 12:12:25 -07:00
David Tolnay
30752ac4ff
Release 1.0.209 2024-08-23 20:29:05 -07:00
David Tolnay
b84e6ca4f5
Improve wording of PR 2805 comments 2024-08-23 20:28:11 -07:00
David Tolnay
87a2fb0f1a
Wrap comments from PR 2805 to 80 columns 2024-08-23 20:25:16 -07:00
David Tolnay
9eaf7b9824
Merge pull request #2805 from Mingun/untagged-tests
Fix deserialization of empty structs and tuples in untagged enums
2024-08-23 20:25:07 -07:00
Mingun
7bde100237 Replace MapRefDeserializer with value::MapDeserializer
Although they are slightly different, this difference is irrelevant:
- MapDeserializer has a specialization for deserialize_seq and deserialize_tuple, but
  only MapRefDeserializer::deserialize_any is used by the code which is almost the same
- MapDeserializer checks that map was consumed after visit_map, but MapRefDeserializer
  does not. Actually, each derived implementation consumes map and each manual implementation
  also should consume it

Also, MapDeserializer already used when value deserialized from ContentRefDeserializer
directly and MapRefDeserializer was only used to deserialize Struct variants of enums.
There are no reasons why the behavior should be different in those two cases
2024-08-24 04:52:26 +05:00
Mingun
da7fc795ee Fix deserialization of empty struct variant in untagged enums
SeqRefDeserializer::deserialize_any has a special condition for empty sequence, which
emits visit_unit. That condition assumes that type would be able to deserialized from
unit, but:
1) struct variants was never able to deserialize from it (they expect only visit_map or visit_seq)
2) tuple variants even with zero fields expect visit_seq only. The suggestion to accept visit_unit
   instead was rejected in #2520

Fixes (2):
    newtype_enum::tuple0
    newtype_enum::empty_struct_from_seq
2024-08-24 04:52:26 +05:00
Mingun
4c5fec1363 Test special cases that reaches SeqRefDeserializer::deserialize_any len==0 condition
failures (2):
    newtype_enum::empty_struct_from_seq
    newtype_enum::tuple0
2024-08-24 04:52:25 +05:00
Mingun
6588b0ad37 Cover Content::Seq case in VariantRefDeserializer::struct_variant 2024-08-24 04:52:25 +05:00
Mingun
0093f74cfe Split test newtype_enum into four tests for each variant
(review this commit with "ignore whitespace changes" option on)
2024-08-24 04:52:25 +05:00
Mingun
171c6da57a Complete coverage of ContentRefDeserializer::deserialize_newtype_struct 2024-08-24 04:52:25 +05:00
Mingun
2dddc7796d Cover ContentRefDeserializer::deserialize_option 2024-08-24 04:52:25 +05:00
Mingun
8514f4119a Remove unnecessary generics 2024-08-24 04:52:24 +05:00
Mingun
98fb7d94aa Move all untagged enum tests (except flatten) into a dedicated module
Moved and renamed:
From test_annotations
- test_expecting_message_untagged_tagged_enum                  => expecting_message
- flatten::enum_::untagged::straitforward                      => contains_flatten

From test_macros
- test_untagged_newtype_struct                                 => newtype_struct
- test_untagged_enum                                           => complex
- test_untagged_enum_with_flattened_integer_key                => contains_flatten_with_integer_key
- test_enum_in_untagged_enum                                   => newtype_enum
- test_untagged_bytes                                          => string_and_bytes
- test_untagged_newtype_variant_containing_unit_struct_not_map => newtype_unit_and_empty_map
2024-08-24 04:52:22 +05:00
David Tolnay
31ca16d9bc
Merge pull request #2804 from Mingun/adjacently-tagged-tests
Consolidate and add new tests of adjacently tagged enums
2024-08-23 14:12:41 -07:00
Mingun
9f72ce695e Struct: add tests for deserialization from sequence
(review this commit with "ignore whitespace changes" option on)
2024-08-16 22:51:42 +05:00
Mingun
c383e4f953 Tuple: add tests for deserialization from sequence
(review this commit with "ignore whitespace changes" option on)
2024-08-16 22:51:16 +05:00
Mingun
a94d8750fb Newtype: move up the test with tag only 2024-08-16 22:51:13 +05:00
Mingun
b0d651be40 Newtype: add tests for deserialization from sequence
(review this commit with "ignore whitespace changes" option on)
2024-08-16 22:51:13 +05:00
Mingun
d5a9c11b5c No need to test integer and byte array field names, they already tested for Unit case
There is no difference what variant is deserialized so we can test only one kind of variant
2024-08-16 22:51:10 +05:00
Mingun
6bfe1c435a Unit: add tests for deserialization from bytes tag and content fields 2024-08-16 22:43:15 +05:00
Mingun
a02da49b87 Unit: add tests for deserialization from integer tag and content fields 2024-08-16 22:43:15 +05:00
Mingun
29dc6c3367 Unit: add tests for deserialization from sequence
(review this commit with "ignore whitespace changes" option on)
2024-08-16 22:38:02 +05:00
Mingun
a7f0bab078 Document fields in internal structs used to deserialize adjacently tagged enums 2024-08-16 21:39:55 +05:00
Mingun
3dc6829303 Integrate bytes test into struct_ test
`newtype` test also integrates test with `Bytes` tag, so be like

Removed the first assert_tokens because it is the same as the first assert in the merged method
2024-08-16 21:39:53 +05:00
Mingun
42e63ff942 Reuse AdjacentlyTagged enum in bytes test
Change 0i32 to 1u8 so the test can be merged with the previous in the next commit
2024-08-16 21:38:23 +05:00
Mingun
df07751e6f Group newtype and newtype_with_newtype tests 2024-08-16 21:36:56 +05:00
Mingun
5445f1741b Reuse AdjacentlyTagged enum in newtype_with_newtype test 2024-08-16 21:36:56 +05:00
Mingun
9d0f811221 Remove unnecessary generic 2024-08-16 21:36:56 +05:00
Mingun
36b9a859c4 Test deserialization of the serialized unit format for adjacently tagged enum 2024-08-16 21:36:55 +05:00