warning: variables can be used directly in the `format!` string --> serde_derive/src/internals/attr.rs:546:36 | 546 | meta.error(format_args!("unknown serde container attribute `{}`", path)) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args = note: `-W clippy::uninlined-format-args` implied by `-W clippy::pedantic` = help: to override `-W clippy::pedantic` add `#[allow(clippy::uninlined_format_args)]` help: change this to | 546 - meta.error(format_args!("unknown serde container attribute `{}`", path)) 546 + meta.error(format_args!("unknown serde container attribute `{path}`")) | warning: variables can be used directly in the `format!` string --> serde_derive/src/internals/attr.rs:940:36 | 940 | meta.error(format_args!("unknown serde variant attribute `{}`", path)) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 940 - meta.error(format_args!("unknown serde variant attribute `{}`", path)) 940 + meta.error(format_args!("unknown serde variant attribute `{path}`")) | warning: variables can be used directly in the `format!` string --> serde_derive/src/internals/attr.rs:1095:33 | 1095 | ... format!("field `{}` does not have lifetime {}", ident, lifetime); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 1095 - format!("field `{}` does not have lifetime {}", ident, lifetime); 1095 + format!("field `{ident}` does not have lifetime {lifetime}"); | warning: variables can be used directly in the `format!` string --> serde_derive/src/internals/attr.rs:1196:47 | 1196 | ... let msg = format!( | _________________________________^ 1197 | | ... "field `{}` does not have lifetime {}", 1198 | | ... ident, lifetime, 1199 | | ... ); | |_______________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args warning: variables can be used directly in the `format!` string --> serde_derive/src/internals/attr.rs:1222:36 | 1222 | meta.error(format_args!("unknown serde field attribute `{}`", path)) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 1222 - meta.error(format_args!("unknown serde field attribute `{}`", path)) 1222 + meta.error(format_args!("unknown serde field attribute `{path}`")) | warning: variables can be used directly in the `format!` string --> serde_derive/src/internals/attr.rs:1415:39 | 1415 | return Err(meta.error(format_args!( | _______________________________________^ 1416 | | "malformed {0} attribute, expected `{0}(serialize = ..., deserialize = ...)`", 1417 | | attr_name, 1418 | | ))); | |_________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args warning: variables can be used directly in the `format!` string --> serde_derive/src/internals/attr.rs:1482:17 | 1482 | format!("unexpected suffix `{}` on string literal", suffix), | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 1482 - format!("unexpected suffix `{}` on string literal", suffix), 1482 + format!("unexpected suffix `{suffix}` on string literal"), | warning: variables can be used directly in the `format!` string --> serde_derive/src/internals/attr.rs:1489:13 | 1489 | / format!( 1490 | | "expected serde {} attribute to be a string: `{} = \"...\"`", 1491 | | attr_name, meta_item_name 1492 | | ), | |_____________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args warning: variables can be used directly in the `format!` string --> serde_derive/src/internals/attr.rs:1604:21 | 1604 | format!("duplicate borrowed lifetime `{}`", lifetime), | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 1604 - format!("duplicate borrowed lifetime `{}`", lifetime), 1604 + format!("duplicate borrowed lifetime `{lifetime}`"), | warning: variables can be used directly in the `format!` string --> serde_derive/src/internals/attr.rs:1778:19 | 1778 | let msg = format!("field `{}` has no lifetimes to borrow", name); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 1778 - let msg = format!("field `{}` has no lifetimes to borrow", name); 1778 + let msg = format!("field `{name}` has no lifetimes to borrow"); | warning: variables can be used directly in the `format!` string --> serde_derive/src/internals/check.rs:41:29 | 41 | ... format!("field must have #[serde(default)] because previous field {} has #[serde(default)]", first), | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 41 - format!("field must have #[serde(default)] because previous field {} has #[serde(default)]", first), 41 + format!("field must have #[serde(default)] because previous field {first} has #[serde(default)]"), | warning: variables can be used directly in the `format!` string --> serde_derive/src/internals/check.rs:314:13 | 314 | format!("variant field name `{}` conflicts with internal tag", tag), | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 314 - format!("variant field name `{}` conflicts with internal tag", tag), 314 + format!("variant field name `{tag}` conflicts with internal tag"), | warning: variables can be used directly in the `format!` string --> serde_derive/src/internals/check.rs:361:13 | 361 | / format!( 362 | | "enum tags `{}` for type and content conflict with each other", 363 | | type_tag 364 | | ), | |_____________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args warning: variables can be used directly in the `format!` string --> serde_derive/src/internals/check.rs:450:33 | 450 | Member::Named(ident) => format!("`{}`", ident), | ^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 450 - Member::Named(ident) => format!("`{}`", ident), 450 + Member::Named(ident) => format!("`{ident}`"), | warning: variables can be used directly in the `format!` string --> serde_derive/src/de.rs:697:9 | 697 | format!("{} with 1 element", expecting) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 697 - format!("{} with 1 element", expecting) 697 + format!("{expecting} with 1 element") | warning: variables can be used directly in the `format!` string --> serde_derive/src/de.rs:699:9 | 699 | format!("{} with {} elements", expecting, deserialized_count) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 699 - format!("{} with {} elements", expecting, deserialized_count) 699 + format!("{expecting} with {deserialized_count} elements") | warning: variables can be used directly in the `format!` string --> serde_derive/src/de.rs:1442:21 | 1442 | let expecting = format!("adjacently tagged enum {}", rust_name); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 1442 - let expecting = format!("adjacently tagged enum {}", rust_name); 1442 + let expecting = format!("adjacently tagged enum {rust_name}"); | warning: variables can be used directly in the `format!` string --> serde_derive/src/de.rs:2842:17 | 2842 | Ident::new(&format!("__field{}", i), Span::call_site()) | ^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 2842 - Ident::new(&format!("__field{}", i), Span::call_site()) 2842 + Ident::new(&format!("__field{i}"), Span::call_site()) | warning: variables can be used directly in the `format!` string --> serde_derive/src/ser.rs:457:42 | 457 | .map(|i| Ident::new(&format!("__field{}", i), Span::call_site())); | ^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 457 - .map(|i| Ident::new(&format!("__field{}", i), Span::call_site())); 457 + .map(|i| Ident::new(&format!("__field{i}"), Span::call_site())); | warning: variables can be used directly in the `format!` string --> serde_derive/src/ser.rs:714:48 | 714 | .map(|i| Member::Named(Ident::new(&format!("__field{}", i), Span::call_site()))) | ^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 714 - .map(|i| Member::Named(Ident::new(&format!("__field{}", i), Span::call_site()))) 714 + .map(|i| Member::Named(Ident::new(&format!("__field{i}"), Span::call_site()))) | warning: variables can be used directly in the `format!` string --> serde_derive/src/ser.rs:832:46 | 832 | let field_expr = Ident::new(&format!("__field{}", i), Span::call_site()); | ^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 832 - let field_expr = Ident::new(&format!("__field{}", i), Span::call_site()); 832 + let field_expr = Ident::new(&format!("__field{i}"), Span::call_site()); | warning: variables can be used directly in the `format!` string --> serde_derive/src/ser.rs:1062:38 | 1062 | let id = Ident::new(&format!("__field{}", i), Span::call_site()); | ^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 1062 - let id = Ident::new(&format!("__field{}", i), Span::call_site()); 1062 + let id = Ident::new(&format!("__field{i}"), Span::call_site()); |
53 lines
1.7 KiB
Rust
53 lines
1.7 KiB
Rust
#![doc(html_root_url = "https://docs.rs/serde_derive_internals/0.29.1")]
|
|
#![cfg_attr(not(check_cfg), allow(unexpected_cfgs))]
|
|
// Ignored clippy lints
|
|
#![allow(
|
|
clippy::cognitive_complexity,
|
|
// clippy bug: https://github.com/rust-lang/rust-clippy/issues/7575
|
|
clippy::collapsible_match,
|
|
clippy::derive_partial_eq_without_eq,
|
|
// clippy bug: https://github.com/rust-lang/rust-clippy/issues/6797
|
|
clippy::manual_map,
|
|
clippy::missing_panics_doc,
|
|
clippy::needless_lifetimes,
|
|
clippy::redundant_field_names,
|
|
clippy::result_unit_err,
|
|
clippy::should_implement_trait,
|
|
clippy::trivially_copy_pass_by_ref,
|
|
clippy::wildcard_in_or_patterns,
|
|
// clippy bug: https://github.com/rust-lang/rust-clippy/issues/5704
|
|
clippy::unnested_or_patterns,
|
|
)]
|
|
// Ignored clippy_pedantic lints
|
|
#![allow(
|
|
clippy::doc_markdown,
|
|
clippy::enum_glob_use,
|
|
clippy::items_after_statements,
|
|
clippy::let_underscore_untyped,
|
|
clippy::manual_assert,
|
|
clippy::match_same_arms,
|
|
// clippy bug: https://github.com/rust-lang/rust-clippy/issues/6984
|
|
clippy::match_wildcard_for_single_variants,
|
|
clippy::missing_errors_doc,
|
|
clippy::module_name_repetitions,
|
|
clippy::must_use_candidate,
|
|
clippy::return_self_not_must_use,
|
|
clippy::similar_names,
|
|
clippy::single_match_else,
|
|
clippy::struct_excessive_bools,
|
|
clippy::too_many_lines,
|
|
clippy::uninlined_format_args,
|
|
clippy::unused_self,
|
|
clippy::wildcard_imports
|
|
)]
|
|
|
|
extern crate proc_macro2;
|
|
extern crate quote;
|
|
extern crate syn;
|
|
|
|
#[cfg_attr(serde_build_from_git, path = "../serde_derive/src/internals/mod.rs")]
|
|
#[cfg_attr(not(serde_build_from_git), path = "src/mod.rs")]
|
|
mod internals;
|
|
|
|
pub use internals::*;
|