Skip to content

Commit

Permalink
Merge pull request #129 from Integral-Tech/destruct-tuple
Browse files Browse the repository at this point in the history
refactor: destruct tuples to enhance readability
  • Loading branch information
k9withabone authored Nov 5, 2024
2 parents 8e7585e + 7fe4459 commit 7f2c9c4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
7 changes: 2 additions & 5 deletions src/cli/systemd_dbus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,7 @@ pub struct UnitFile {
}

impl From<(String, String)> for UnitFile {
fn from(value: (String, String)) -> Self {
Self {
file_name: value.0,
status: value.1,
}
fn from((file_name, status): (String, String)) -> Self {
Self { file_name, status }
}
}
4 changes: 2 additions & 2 deletions src/quadlet/container/mount/tmpfs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,8 @@ impl<'de> de::Visitor<'de> for Visitor {
Field::Mode => {
check_duplicate(&mode, Field::Mode)?;
// serde(with = "mode")
let value: SerdeMode = map.next_value()?;
mode = Some(value.0);
let SerdeMode(value) = map.next_value()?;
mode = Some(value);
}
// tmpcopyup, notmpcopyup values (de)serialize as unit (i.e. no value)
Field::TmpCopyUp => tmpcopyup = true,
Expand Down
2 changes: 1 addition & 1 deletion src/serde.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ where
S: Serializer,
{
let iter = value.into_iter();
let len = iter.size_hint().1;
let (_, len) = iter.size_hint();

let mut state = serializer.serialize_seq(len)?;

Expand Down

0 comments on commit 7f2c9c4

Please sign in to comment.