Commit Graph

798 Commits

Author SHA1 Message Date
Uzair Aftab
df4ad5884d Fix: Use &[T] instead of &Vec<T> 2023-08-21 09:44:03 +02:00
David Tolnay
3c7dd6fc1e
Release 1.0.185 2023-08-20 21:41:21 -07:00
David Tolnay
1f8c8ad5a3
Fix "cannot move out of *self which is behind a shared reference" 2023-08-20 21:37:14 -07:00
pinkforest
360606b9a6
Following consensus on: #2580 (review)
This PR phases out the precompiled per final consensus made in #2580
i#
Fix a cfg
2023-08-21 13:53:48 +10:00
David Tolnay
151b45ae36
Release 1.0.184 2023-08-20 19:49:55 -07:00
David Tolnay
8d3a03288b
Treat unmatched non-exhaustive remote variant as serde(skip) 2023-08-13 21:14:33 -07:00
David Tolnay
45271c3676
Resolve ignored_unit_patterns pedantic clippy lint
warning: matching over `()` is more explicit
       --> serde_derive/src/internals/attr.rs:710:33
        |
    710 |         (Some((untagged_tokens, _)), Some((tag_tokens, _)), None) => {
        |                                 ^ help: use `()` instead of `_`: `()`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ignored_unit_patterns
        = note: `-W clippy::ignored-unit-patterns` implied by `-W clippy::pedantic`

    warning: matching over `()` is more explicit
       --> serde_derive/src/internals/attr.rs:721:33
        |
    721 |         (Some((untagged_tokens, _)), None, Some((content_tokens, _))) => {
        |                                 ^ help: use `()` instead of `_`: `()`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ignored_unit_patterns

    warning: matching over `()` is more explicit
       --> serde_derive/src/internals/attr.rs:728:33
        |
    728 |         (Some((untagged_tokens, _)), Some((tag_tokens, _)), Some((content_tokens, _))) => {
        |                                 ^ help: use `()` instead of `_`: `()`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ignored_unit_patterns

    warning: matching over `()` is more explicit
       --> serde_derive/src/internals/attr.rs:750:44
        |
    750 |         (_, Some((field_identifier_tokens, _)), Some((variant_identifier_tokens, _))) => {
        |                                            ^ help: use `()` instead of `_`: `()`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ignored_unit_patterns

    warning: matching over `()` is more explicit
       --> serde_derive/src/internals/attr.rs:750:82
        |
    750 |         (_, Some((field_identifier_tokens, _)), Some((variant_identifier_tokens, _))) => {
        |                                                                                  ^ help: use `()` instead of `_`: `()`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ignored_unit_patterns
2023-08-11 20:27:21 -07:00
David Tolnay
05a5b7e3c6
Release 1.0.183 2023-08-06 21:00:14 -07:00
Mingun
070cce0d9c Get rid of temporary variable 2023-08-06 19:55:48 +05:00
Mingun
b58e8bac12 Replace if let Some(...) = ... to Option::map 2023-08-06 19:53:39 +05:00
Mingun
ada50b077e ignore_variant variable is always None, let's take this into account 2023-08-06 19:36:48 +05:00
Mingun
5e313a7330 Move generiс code out-of-function, create more specialized and simple code 2023-08-06 19:35:27 +05:00
Mingun
2a36d11238 Introduce a dedicated function for generating Field enum
(the enum that represents all fields of a struct)
2023-08-06 19:32:53 +05:00
David Tolnay
b6685cf9dd
Release 1.0.182 2023-08-05 22:16:46 -07:00
David Tolnay
fc273c6763
Resolve needless_return clippy lint in PR 2553
warning: unneeded `return` statement
        --> serde_derive/src/de.rs:2986:13
         |
    2986 |             return quote!(#assign_to __default.#member);
         |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
         = note: `-W clippy::needless-return` implied by `-W clippy::all`
    help: remove `return`
         |
    2986 -             return quote!(#assign_to __default.#member);
    2986 +             quote!(#assign_to __default.#member)
         |
2023-08-05 22:16:19 -07:00
David Tolnay
bd7b0e257e
Touch up PR 2553 2023-08-05 22:13:09 -07:00
David Tolnay
73931692b2
Merge pull request #2553 from Mingun/default-on-tuples
Allow `#[serde(default)]` on tuple structs
2023-08-05 22:12:10 -07:00
David Tolnay
4d93e9f44c
Keep deserialize aliases as a sorted set 2023-08-05 17:06:11 -07:00
David Tolnay
da55ed7e8d
Remove some clones of names of things 2023-08-05 17:01:34 -07:00
David Tolnay
e3617e1f28
Update explanation of correct_aliases 2023-08-05 16:39:38 -07:00
David Tolnay
431636af0d
Merge pull request #2458 from Mingun/identifier
Keep aliases always sorted and include aliases in expecting message for field/variant_identifier
2023-08-05 16:39:14 -07:00
David Tolnay
57dc0ee769
Release 1.0.181 2023-08-03 16:58:45 -07:00
Mingun
5c33931422 Allow #[serde(default)] on tuple structs 2023-08-03 22:32:34 +05:00
David Tolnay
4aa54222f4
Delete double reference when setting up adjacently tagged variant seed 2023-08-01 22:54:47 -07:00
David Tolnay
ef4f860384
Improve "expecting" message of adjacently tagged enum variant 2023-08-01 22:49:44 -07:00
David Tolnay
9bd52ec5c1
Inline AdjacentlyTaggedEnumVariant::new 2023-08-01 22:38:47 -07:00
David Tolnay
5cdd82d41e
Remove Serializer from name of private type that is not a Serializer 2023-08-01 22:26:04 -07:00
David Tolnay
43035f6f37
Merge pull request #2505 from Baptistemontan/rework_adjacently_tagged_enum
Revisit of the representation of adjacently tagged enums tag
2023-08-01 22:25:31 -07:00
Mingun
878110a4bc Simplify code after dead code elimination 2023-08-01 19:03:21 +05:00
Mingun
59ec8b7db2 Remove dead code - variant_ident and deserializer are always None 2023-08-01 19:03:20 +05:00
Mingun
cae1b43829 Inline deserialize_newtype_struct_in_place 2023-08-01 19:03:19 +05:00
Mingun
99fde4ee3e Implement #2387 also for deserialize_in_place method 2023-08-01 19:03:19 +05:00
Mingun
afe3872810 Simplify check for missing fields 2023-08-01 19:03:18 +05:00
Mingun
3a3e6bf103 Reorder variables to match order in final quote! 2023-08-01 19:03:18 +05:00
Mingun
935f0bd70f Merge some quote! blocks 2023-08-01 19:03:17 +05:00
Mingun
5c18bfeda6 Inline deserialize_struct_as_struct_in_place_visitor 2023-08-01 19:03:17 +05:00
Baptiste de Montangon
957ef206d1
Revisit of the representation of adjacently tagged enums tag 2023-07-31 20:53:02 +02:00
David Tolnay
033d05f70b
Release 1.0.180 2023-07-31 11:16:12 -07:00
David Tolnay
f969080b9f
Pull in syn fix that makes serde test suite independent of "full" feature
See https://github.com/dtolnay/syn/pull/1491.
2023-07-30 17:39:44 -07:00
David Tolnay
c2b16bfbb0
Release 1.0.179 2023-07-30 17:20:10 -07:00
David Tolnay
48aa054f53
Release 1.0.178 2023-07-28 16:09:39 -07:00
David Tolnay
6f1f38d046
Replace 'try!' with '?' in serde_derive 2023-07-27 19:16:11 -07:00
David Tolnay
db8f06467b
Eliminate workaround for pre-1.17 rustc in serde_derive
The oldest compiler supported by serde_derive by this point is 1.56.
2023-07-27 19:05:57 -07:00
David Tolnay
0676673ca5
Release 1.0.177 2023-07-27 10:51:22 -07:00
Jonas Platte
31a0e73489
Update error span for attribute / data kind mismatches 2023-07-27 10:47:45 +02:00
David Tolnay
e74925bc43
Merge pull request #1695 from jplatte/rename_all_fields
Add #[serde(rename_all_fields = "foo")] attribute
2023-07-27 00:45:45 -07:00
Jonas Platte
56be1c203e
Pass RenameRule, RenameAllRules by value 2023-07-27 09:19:42 +02:00
Jonas Platte
2f9bf4d3eb
Add #[serde(rename_all_fields = "foo")] attribute 2023-07-27 09:19:42 +02:00
David Tolnay
30db83fc44
Restore bare_trait_objects lint within serde_derive code 2023-07-26 14:18:25 -07:00
David Tolnay
85d5c1fd38
Release 1.0.176 2023-07-26 13:37:44 -07:00