Skip to content

Commit

Permalink
refactor(toml): clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
azzamsa committed Dec 21, 2022
1 parent e54eb93 commit b16f4eb
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
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

0 comments on commit b16f4eb

Please sign in to comment.