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 7e8b5b4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 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 @@ -518,7 +518,7 @@ impl<'de, 'b> de::MapAccess<'de> for MapVisitor<'de, 'b> {
let res = seed.deserialize(MapVisitor {
values: Vec::new().into_iter().peekable(),
next_value: None,
depth: self.depth + if array { 0 } else { 1 },
depth: self.depth + usize::from(!array),
cur_parent: self.cur - 1,
cur: 0,
max: self.max,
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
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 7e8b5b4

Please sign in to comment.