4338 Commits

Author SHA1 Message Date
David Tolnay
d17902059e
Merge pull request #3019 from xibeiyoumian/master
chore: improve code comments clarity
2025-12-22 03:29:10 -08:00
xibeiyoumian
a27948e209 chore: improve code comments clarity
Signed-off-by: xibeiyoumian <xibeiyoumian@outlook.com>
2025-12-22 14:38:55 +08:00
David Tolnay
576e2ef9d8
Update actions/upload-artifact@v5 -> v6 2025-12-19 21:10:59 -08:00
David Tolnay
dd0eb0f2ca
Update actions/upload-artifact@v4 -> v5 2025-12-18 18:58:13 -08:00
David Tolnay
f7fc3e0d67
Update actions/checkout@v5 -> v6 2025-11-20 10:19:51 -08:00
David Tolnay
1c396d223b
Update actions/checkout@v4 -> v5 2025-11-20 10:19:04 -08:00
David Tolnay
e42684f9a7
Update ui test suite to nightly-2025-11-02 2025-11-01 22:38:40 -07:00
David Tolnay
56c29b3c5d
Update name of empty_enum clippy lint
warning: lint `clippy::empty_enum` has been renamed to `clippy::empty_enums`
       --> serde/src/lib.rs:122:5
        |
    122 |     clippy::empty_enum,
        |     ^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::empty_enums`
        |
        = note: `#[warn(renamed_and_removed_lints)]` on by default

    warning: lint `clippy::empty_enum` has been renamed to `clippy::empty_enums`
      --> serde_core/src/lib.rs:57:5
       |
    57 |     clippy::empty_enum,
       |     ^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::empty_enums`
       |
       = note: `#[warn(renamed_and_removed_lints)]` on by default

    warning: lint `clippy::empty_enum` has been renamed to `clippy::empty_enums`
     --> test_suite/tests/test_de.rs:5:5
      |
    5 |     clippy::empty_enum,
      |     ^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::empty_enums`
      |
      = note: `#[warn(renamed_and_removed_lints)]` on by default

    warning: lint `clippy::empty_enum` has been renamed to `clippy::empty_enums`
     --> test_suite/tests/test_de_error.rs:3:5
      |
    3 |     clippy::empty_enum,
      |     ^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::empty_enums`
      |
      = note: `#[warn(renamed_and_removed_lints)]` on by default
2025-11-01 22:37:05 -07:00
David Tolnay
5a44519a9a
Raise required compiler for serde_derive to Rust 1.68 2025-10-19 15:02:17 -07:00
David Tolnay
fae23fea97
Resolve manual_let_else pedantic clippy lint
warning: this could be rewritten as `let...else`
        --> serde_derive/src/internals/attr.rs:1460:5
         |
    1460 | /     let string = match get_lit_str(cx, attr_name, meta)? {
    1461 | |         Some(string) => string,
    1462 | |         None => return Ok(None),
    1463 | |     };
         | |______^ help: consider writing: `let Some(string) = get_lit_str(cx, attr_name, meta)? else { return Ok(None) };`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_let_else
         = note: `-W clippy::manual-let-else` implied by `-W clippy::pedantic`
         = help: to override `-W clippy::pedantic` add `#[allow(clippy::manual_let_else)]`

    warning: this could be rewritten as `let...else`
        --> serde_derive/src/internals/attr.rs:1482:5
         |
    1482 | /     let string = match get_lit_str(cx, attr_name, meta)? {
    1483 | |         Some(string) => string,
    1484 | |         None => return Ok(None),
    1485 | |     };
         | |______^ help: consider writing: `let Some(string) = get_lit_str(cx, attr_name, meta)? else { return Ok(None) };`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_let_else

    warning: this could be rewritten as `let...else`
        --> serde_derive/src/internals/attr.rs:1505:5
         |
    1505 | /     let string = match get_lit_str2(cx, attr_name, meta_item_name, meta)? {
    1506 | |         Some(string) => string,
    1507 | |         None => return Ok(Vec::new()),
    1508 | |     };
         | |______^ help: consider writing: `let Some(string) = get_lit_str2(cx, attr_name, meta_item_name, meta)? else { return Ok(Vec::new()) };`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_let_else

    warning: this could be rewritten as `let...else`
        --> serde_derive/src/internals/attr.rs:1526:5
         |
    1526 | /     let string = match get_lit_str(cx, attr_name, meta)? {
    1527 | |         Some(string) => string,
    1528 | |         None => return Ok(None),
    1529 | |     };
         | |______^ help: consider writing: `let Some(string) = get_lit_str(cx, attr_name, meta)? else { return Ok(None) };`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_let_else

    warning: this could be rewritten as `let...else`
        --> serde_derive/src/internals/attr.rs:1549:5
         |
    1549 | /     let string = match get_lit_str(cx, BORROW, meta)? {
    1550 | |         Some(string) => string,
    1551 | |         None => return Ok(BTreeSet::new()),
    1552 | |     };
         | |______^ help: consider writing: `let Some(string) = get_lit_str(cx, BORROW, meta)? else { return Ok(BTreeSet::new()) };`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_let_else

    warning: this could be rewritten as `let...else`
        --> serde_derive/src/internals/attr.rs:1621:5
         |
    1621 | /     let seg = match path.segments.last() {
    1622 | |         Some(seg) => seg,
    1623 | |         None => {
    1624 | |             return false;
    1625 | |         }
    1626 | |     };
         | |______^
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_let_else
    help: consider writing
         |
    1621 ~     let Some(seg) = path.segments.last() else {
    1622 +             return false;
    1623 +         };
         |

    warning: this could be rewritten as `let...else`
        --> serde_derive/src/internals/attr.rs:1648:5
         |
    1648 | /     let seg = match path.segments.last() {
    1649 | |         Some(seg) => seg,
    1650 | |         None => {
    1651 | |             return false;
    1652 | |         }
    1653 | |     };
         | |______^
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_let_else
    help: consider writing
         |
    1648 ~     let Some(seg) = path.segments.last() else {
    1649 +             return false;
    1650 +         };
         |

    warning: this could be rewritten as `let...else`
      --> serde_derive/src/internals/ctxt.rs:49:9
       |
    49 | /         let mut combined = match errors.next() {
    50 | |             Some(first) => first,
    51 | |             None => return Ok(()),
    52 | |         };
       | |__________^ help: consider writing: `let Some(mut combined) = errors.next() else { return Ok(()) };`
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_let_else

    warning: this could be rewritten as `let...else`
      --> serde_derive/src/de.rs:29:5
       |
    29 | /     let cont = match Container::from_ast(&ctxt, input, Derive::Deserialize, &private...
    30 | |         Some(cont) => cont,
    31 | |         None => return Err(ctxt.check().unwrap_err()),
    32 | |     };
       | |______^ help: consider writing: `let Some(cont) = Container::from_ast(&ctxt, input, Derive::Deserialize, &private.ident()) else { return Err(ctxt.check().unwrap_err()) };`
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_let_else

    warning: this could be rewritten as `let...else`
      --> serde_derive/src/ser.rs:16:5
       |
    16 | /     let cont = match Container::from_ast(&ctxt, input, Derive::Serialize, &private.i...
    17 | |         Some(cont) => cont,
    18 | |         None => return Err(ctxt.check().unwrap_err()),
    19 | |     };
       | |______^ help: consider writing: `let Some(cont) = Container::from_ast(&ctxt, input, Derive::Serialize, &private.ident()) else { return Err(ctxt.check().unwrap_err()) };`
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_let_else
2025-10-19 15:02:16 -07:00
David Tolnay
d656b4dd6a
Raise required compiler for serde_derive to Rust 1.65 2025-10-19 15:02:12 -07:00
David Tolnay
b517ec9fd7
Merge pull request #3001 from nik-contrib/refactor
refactor: remove 1 level of nesting
2025-10-17 10:35:18 -07:00
Nik Revenco
086353c581 refactor: remove 1 level of nesting 2025-10-17 18:29:26 +01:00
David Tolnay
4e278703c6
Merge pull request #2936 from Mingun/remove-fixme
Remove some ? from generated code
2025-09-28 11:34:47 -07:00
Mingun
9f9a1ea35e Do not use ? operator in the generated code where possible
This may slightly improve compilation time and costs nothing
2025-09-28 23:21:26 +05:00
David Tolnay
a866b336f1
Release 1.0.228 v1.0.228 2025-09-27 09:51:07 -07:00
David Tolnay
5adc9e816c
Merge pull request #2995 from dtolnay/rustdocflags
Workaround for RUSTDOCFLAGS='--cfg=docsrs'
2025-09-27 09:50:33 -07:00
David Tolnay
ab581789f4
Workaround for RUSTDOCFLAGS='--cfg=docsrs' 2025-09-27 09:46:14 -07:00
David Tolnay
415d9fc560
Release 1.0.227 v1.0.227 2025-09-25 16:42:33 -07:00
David Tolnay
7c58427e12
Merge pull request #2991 from dtolnay/inlinecoredoc
Inline serde_core into serde in docsrs mode
2025-09-25 16:41:35 -07:00
David Tolnay
9d3410e3f4
Merge pull request #2992 from dtolnay/inplaceseed
Remove InPlaceSeed public re-export
2025-09-25 16:40:54 -07:00
David Tolnay
2fb6748bf1
Remove InPlaceSeed public re-export 2025-09-25 16:26:14 -07:00
David Tolnay
f8137c79a2
Inline serde_core into serde in docsrs mode 2025-09-25 13:22:15 -07:00
David Tolnay
b7dbf7e3cb
Merge pull request #2990 from dtolnay/integer128
No longer macro_use integer128 module
2025-09-25 11:14:43 -07:00
David Tolnay
7c836915fc
No longer macro_use integer128 module 2025-09-25 11:09:19 -07:00
David Tolnay
aa2d9b208a
Merge pull request #2989 from dtolnay/pr2987
PR 2987 followup
2025-09-25 09:45:25 -07:00
David Tolnay
3a7c11c82c
Rename enum_untagged::generate_newtype_variant -> deserialize_newtype_variant 2025-09-25 09:41:34 -07:00
David Tolnay
11ce4402bd
Rename enum_untagged::generate_variant -> deserialize_variant 2025-09-25 09:41:34 -07:00
David Tolnay
8047570160
Rename generate_body_in_place -> deserialize_in_place 2025-09-25 09:41:34 -07:00
David Tolnay
b395215875
Rename all other generate_body -> deserialize 2025-09-25 09:41:33 -07:00
David Tolnay
a437ff6bf7
Rename identifier::generate_identifier -> deserialize_generated 2025-09-25 09:41:33 -07:00
David Tolnay
20fc31c78a
Rename identifier::generate_body -> deserialize_custom 2025-09-25 09:41:33 -07:00
David Tolnay
ad2b064b0a
Adjust variable names 2025-09-25 09:41:33 -07:00
David Tolnay
dec153b8fa
Adjust comments 2025-09-25 09:41:33 -07:00
David Tolnay
e219a0d4b7
Replace unnecessary use of generics_with_de_lifetime 2025-09-25 09:41:33 -07:00
David Tolnay
c78f7d2e30
Rename Parameters::generics -> generics_with_de_lifetime 2025-09-25 09:41:33 -07:00
David Tolnay
502a065a4c
Merge pull request #2987 from Mingun/split-de-generator
Refactor: split de generator over multiple files
2025-09-25 09:41:29 -07:00
Mingun
027112eccb Visibility fix for Rust 1.61 2025-09-21 20:58:53 +05:00
Mingun
8c3445efe4 Group some functions that used together 2025-09-21 20:40:22 +05:00
Mingun
88b6a9abf4 Rename functions and run cargo fmt 2025-09-21 20:40:21 +05:00
Mingun
fa298c9df4 Move generator for identifiers to its own module
Cut-paste
2025-09-21 20:40:21 +05:00
Mingun
c4a07ed4e8 Move body generator for unit structs to its own module
Cut-paste
2025-09-21 20:40:21 +05:00
Mingun
c4986f10b9 Move body generator for tuple structs to its own module
Cut-paste
2025-09-21 20:40:21 +05:00
Mingun
2d607de146 Move body generator for structs to its own module
Cut-paste
2025-09-21 20:40:21 +05:00
Mingun
19956e6b8e Move body generator for enums to its own module
Cut-paste
2025-09-21 20:40:20 +05:00
Mingun
ec13eb4ed6 Move body generator for untagged enums to its own module
Cut-paste
2025-09-21 20:40:20 +05:00
Mingun
ae00c4acb7 Move body generator for internally tagged enums to its own module
Cut-paste
2025-09-21 20:40:20 +05:00
Mingun
85d0b9ccd8 Move body generator for externally tagged enums to its own module
Cut-paste
2025-09-21 20:40:20 +05:00
Mingun
e60f62a289 Move body generator for adjacently tagged enums to its own module
Cut-paste
2025-09-21 20:40:20 +05:00
Mingun
e04f0ba2de StructForm::InternallyTagged always instantiated with the same deserializer, so remove that parameter 2025-09-21 20:40:20 +05:00