Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(toml): clippy #399

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions crates/toml/src/de.rs
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ impl<'de, 'b> de::MapAccess<'de> for MapVisitor<'de, 'b> {
let name = self.tables[pos]
.header
.iter()
.map(|k| k.1.to_owned())
.map(|k| k.1.clone())
.collect::<Vec<_>>()
.join(".");
return Err(self.de.error(at, ErrorKind::DuplicateTable(name)));
Expand Down Expand Up @@ -682,7 +682,7 @@ impl<'de, 'b> de::Deserializer<'de> for MapVisitor<'de, 'b> {
if table.header.is_empty() {
return Err(self.de.error(self.cur, ErrorKind::EmptyTableKey));
}
let name = table.header[table.header.len() - 1].1.to_owned();
let name = table.header[table.header.len() - 1].1.clone();
visitor.visit_enum(DottedTableDeserializer {
name,
value: Value {
Expand Down
1 change: 1 addition & 0 deletions crates/toml/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@
//! [`serde`]: https://serde.rs/
//! [serde]: https://serde.rs/

#![allow(clippy::bool_to_int_with_if)]
#![deny(missing_docs)]
#![warn(rust_2018_idioms)]
// Makes rustc abort compilation if there are any unsafe blocks in the crate.
Expand Down
2 changes: 1 addition & 1 deletion crates/toml/src/ser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1140,7 +1140,7 @@ impl<'a, 'b> ser::SerializeStruct for SerializeTable<'a, 'b> {
match *self {
SerializeTable::Datetime(ref mut ser) => {
if key == datetime::FIELD {
value.serialize(DateStrEmitter(*ser))?;
value.serialize(DateStrEmitter(ser))?;
} else {
return Err(Error::DateInvalid);
}
Expand Down