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: destruct tuples to enhance readability #129

Merged
merged 1 commit into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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