Format in rfc style

This commit is contained in:
David Tolnay
2017-04-18 14:23:21 -07:00
parent c567e749ef
commit 7a7d4c6364
12 changed files with 180 additions and 149 deletions
+6 -3
View File
@@ -28,8 +28,10 @@ fn check_getter(cx: &Ctxt, cont: &Container) {
}
Body::Struct(_, _) => {
if cont.body.has_getter() && cont.attrs.remote().is_none() {
cx.error("#[serde(getter = \"...\")] can only be used in structs \
that have #[serde(remote = \"...\")]");
cx.error(
"#[serde(getter = \"...\")] can only be used in structs \
that have #[serde(remote = \"...\")]",
);
}
}
}
@@ -52,7 +54,8 @@ fn check_identifier(cx: &Ctxt, cont: &Container) {
for (i, variant) in variants.iter().enumerate() {
match (variant.style, cont.attrs.identifier(), variant.attrs.other()) {
// The `other` attribute may only be used in a field_identifier.
(_, Identifier::Variant, true) | (_, Identifier::No, true) => {
(_, Identifier::Variant, true) |
(_, Identifier::No, true) => {
cx.error("#[serde(other)] may only be used inside a field_identifier");
}