mirror of
https://github.com/serde-rs/serde.git
synced 2025-11-16 21:35:51 +00:00
Resolve semicolon_if_nothing_returned clippy lints
error: consider adding a `;` to the last statement for consistent formatting
--> serde_derive/src/internals/attr.rs:559:25
|
559 | serde_path.set(&m.path, path)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add a `;` here: `serde_path.set(&m.path, path);`
|
note: the lint level is defined here
--> serde_derive/src/lib.rs:18:22
|
18 | #![deny(clippy::all, clippy::pedantic)]
| ^^^^^^^^^^^^^^^^
= note: `#[deny(clippy::semicolon_if_nothing_returned)]` implied by `#[deny(clippy::pedantic)]`
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned
error: consider adding a `;` to the last statement for consistent formatting
--> serde_derive/src/internals/attr.rs:1612:9
|
1612 | cx.error_spanned_by(lit, format!("failed to parse path: {:?}", string.value()))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add a `;` here: `cx.error_spanned_by(lit, format!("failed to parse path: {:?}", string.value()));`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned
error: consider adding a `;` to the last statement for consistent formatting
--> serde_derive/src/internals/attr.rs:1623:9
|
1623 | cx.error_spanned_by(lit, format!("failed to parse path: {:?}", string.value()))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add a `;` here: `cx.error_spanned_by(lit, format!("failed to parse path: {:?}", string.value()));`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned
error: consider adding a `;` to the last statement for consistent formatting
--> serde_derive/src/internals/attr.rs:1649:9
|
1649 | / cx.error_spanned_by(
1650 | | lit,
1651 | | format!("failed to parse type: {} = {:?}", attr_name, string.value()),
1652 | | )
| |_________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned
help: add a `;` here
|
1649 | cx.error_spanned_by(
1650 | lit,
1651 | format!("failed to parse type: {} = {:?}", attr_name, string.value()),
1652 | );
|
error: consider adding a `;` to the last statement for consistent formatting
--> serde_derive/src/internals/check.rs:260:9
|
260 | / cx.error_spanned_by(
261 | | cont.original,
262 | | format!("variant field name `{}` conflicts with internal tag", tag),
263 | | )
| |_________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned
help: add a `;` here
|
260 | cx.error_spanned_by(
261 | cont.original,
262 | format!("variant field name `{}` conflicts with internal tag", tag),
263 | );
|
error: consider adding a `;` to the last statement for consistent formatting
--> serde_derive/src/de.rs:2090:9
|
2090 | flat_fields.extend(aliases.iter().map(|alias| (alias, ident)))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add a `;` here: `flat_fields.extend(aliases.iter().map(|alias| (alias, ident)));`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned
This commit is contained in:
parent
985725f820
commit
967795414b
@ -2087,7 +2087,7 @@ fn deserialize_identifier(
|
|||||||
) -> Fragment {
|
) -> Fragment {
|
||||||
let mut flat_fields = Vec::new();
|
let mut flat_fields = Vec::new();
|
||||||
for (_, ident, aliases) in fields {
|
for (_, ident, aliases) in fields {
|
||||||
flat_fields.extend(aliases.iter().map(|alias| (alias, ident)))
|
flat_fields.extend(aliases.iter().map(|alias| (alias, ident)));
|
||||||
}
|
}
|
||||||
|
|
||||||
let field_strs: &Vec<_> = &flat_fields.iter().map(|(name, _)| name).collect();
|
let field_strs: &Vec<_> = &flat_fields.iter().map(|(name, _)| name).collect();
|
||||||
|
|||||||
@ -556,7 +556,7 @@ impl Container {
|
|||||||
// Parse `#[serde(crate = "foo")]`
|
// Parse `#[serde(crate = "foo")]`
|
||||||
Meta(NameValue(m)) if m.path == CRATE => {
|
Meta(NameValue(m)) if m.path == CRATE => {
|
||||||
if let Ok(path) = parse_lit_into_path(cx, CRATE, &m.lit) {
|
if let Ok(path) = parse_lit_into_path(cx, CRATE, &m.lit) {
|
||||||
serde_path.set(&m.path, path)
|
serde_path.set(&m.path, path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1609,7 +1609,7 @@ fn get_lit_str2<'a>(
|
|||||||
fn parse_lit_into_path(cx: &Ctxt, attr_name: Symbol, lit: &syn::Lit) -> Result<syn::Path, ()> {
|
fn parse_lit_into_path(cx: &Ctxt, attr_name: Symbol, lit: &syn::Lit) -> Result<syn::Path, ()> {
|
||||||
let string = get_lit_str(cx, attr_name, lit)?;
|
let string = get_lit_str(cx, attr_name, lit)?;
|
||||||
parse_lit_str(string).map_err(|_| {
|
parse_lit_str(string).map_err(|_| {
|
||||||
cx.error_spanned_by(lit, format!("failed to parse path: {:?}", string.value()))
|
cx.error_spanned_by(lit, format!("failed to parse path: {:?}", string.value()));
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1620,7 +1620,7 @@ fn parse_lit_into_expr_path(
|
|||||||
) -> Result<syn::ExprPath, ()> {
|
) -> Result<syn::ExprPath, ()> {
|
||||||
let string = get_lit_str(cx, attr_name, lit)?;
|
let string = get_lit_str(cx, attr_name, lit)?;
|
||||||
parse_lit_str(string).map_err(|_| {
|
parse_lit_str(string).map_err(|_| {
|
||||||
cx.error_spanned_by(lit, format!("failed to parse path: {:?}", string.value()))
|
cx.error_spanned_by(lit, format!("failed to parse path: {:?}", string.value()));
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1649,7 +1649,7 @@ fn parse_lit_into_ty(cx: &Ctxt, attr_name: Symbol, lit: &syn::Lit) -> Result<syn
|
|||||||
cx.error_spanned_by(
|
cx.error_spanned_by(
|
||||||
lit,
|
lit,
|
||||||
format!("failed to parse type: {} = {:?}", attr_name, string.value()),
|
format!("failed to parse type: {} = {:?}", attr_name, string.value()),
|
||||||
)
|
);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -260,7 +260,7 @@ fn check_internal_tag_field_name_conflict(cx: &Ctxt, cont: &Container) {
|
|||||||
cx.error_spanned_by(
|
cx.error_spanned_by(
|
||||||
cont.original,
|
cont.original,
|
||||||
format!("variant field name `{}` conflicts with internal tag", tag),
|
format!("variant field name `{}` conflicts with internal tag", tag),
|
||||||
)
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
for variant in variants {
|
for variant in variants {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user