update clippy and fix error messages

This commit is contained in:
Marc-Antoine Arnaud 2018-11-05 17:30:21 +01:00
parent cf14e838da
commit dca18e2f82
5 changed files with 10 additions and 10 deletions

View File

@ -24,8 +24,8 @@ matrix:
- cargo fmt -- --write-mode=diff
# Clippy
- env: CLIPPY_VERSION="0.0.191"
rust: nightly-2018-04-01
- env: CLIPPY_VERSION="0.0.212"
rust: nightly-2018-10-05
install:
- travis_wait cargo install clippy --version $CLIPPY_VERSION || echo "clippy already installed"
script:

View File

@ -151,7 +151,7 @@ pub fn parse(
.map(|variant| {
let field_attrs = YaSerdeAttribute::parse(&variant.attrs);
let renamed_label = match field_attrs.rename {
Some(value) => Ident::new(&format!("{}", value), Span::call_site()),
Some(value) => Ident::new(&value.to_string(), Span::call_site()),
None => variant.ident.clone(),
};
let label = &variant.ident;

View File

@ -130,7 +130,7 @@ pub fn parse(
.map(|field| {
let field_attrs = YaSerdeAttribute::parse(&field.attrs);
let label_name = if let Some(value) = field_attrs.rename {
Ident::new(&format!("{}", value), Span::call_site()).to_string()
Ident::new(&value.to_string(), Span::call_site()).to_string()
} else {
field.ident.clone().unwrap().to_string()
};
@ -313,7 +313,7 @@ pub fn parse(
}
let label_name = if let Some(value) = field_attrs.rename {
Ident::new(&format!("{}", value), Span::call_site()).to_string()
Ident::new(&value.to_string(), Span::call_site()).to_string()
} else {
field.ident.clone().unwrap().to_string()
};
@ -781,7 +781,7 @@ pub fn parse(
let label = &field.ident;
let label_name = if let Some(value) = field_attrs.rename {
Ident::new(&format!("{}", value), Span::call_site()).to_string()
Ident::new(&value.to_string(), Span::call_site()).to_string()
} else {
field.ident.clone().unwrap().to_string()
};

View File

@ -19,7 +19,7 @@ pub fn serialize(
.map(|variant| {
let variant_attrs = YaSerdeAttribute::parse(&variant.attrs);
let renamed_label = match variant_attrs.rename {
Some(value) => Ident::new(&format!("{}", value), Span::call_site()),
Some(value) => Ident::new(&value.to_string(), Span::call_site()),
None => variant.ident.clone(),
};
let label = &variant.ident;
@ -55,7 +55,7 @@ pub fn serialize(
}
let renamed_field_label = match field_attrs.rename {
Some(value) => Some(Ident::new(&format!("{}", value), Span::call_site())),
Some(value) => Some(Ident::new(&value.to_string(), Span::call_site())),
None => field.ident.clone(),
};
let field_label_name = renamed_field_label.unwrap().to_string();

View File

@ -23,7 +23,7 @@ pub fn serialize(
}
let renamed_label = match field_attrs.rename {
Some(value) => Ident::new(&format!("{}", value), Span::call_site()),
Some(value) => Ident::new(&value.to_string(), Span::call_site()),
None => field.ident.clone().unwrap(),
};
let label = &field.ident;
@ -165,7 +165,7 @@ pub fn serialize(
}
let renamed_label = match field_attrs.rename {
Some(value) => Ident::new(&format!("{}", value), Span::call_site()),
Some(value) => Ident::new(&value.to_string(), Span::call_site()),
None => field.ident.clone().unwrap(),
};