Skip to content

Commit 56062b3

Browse files
author
faukah
committed
nixos: apply clippy lints
1 parent 4073ef6 commit 56062b3

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/nixos.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,7 @@ impl OsRebuildArgs {
153153
let toplevel = toplevel_for(
154154
&target_hostname,
155155
installable,
156-
final_attr
157-
.unwrap_or_else(|| String::from("toplevel"))
158-
.as_str(),
156+
final_attr.as_deref().unwrap_or("toplevel"),
159157
);
160158

161159
let message = match variant {
@@ -776,7 +774,7 @@ pub fn toplevel_for<S: AsRef<str>>(
776774
final_attr: &str,
777775
) -> Installable {
778776
let mut res = installable;
779-
let hostname = hostname.as_ref().to_owned();
777+
let hostname_str = hostname.as_ref();
780778

781779
let toplevel = ["config", "system", "build", final_attr]
782780
.into_iter()
@@ -790,7 +788,7 @@ pub fn toplevel_for<S: AsRef<str>>(
790788
// nixosConfigurations
791789
if attribute.is_empty() {
792790
attribute.push(String::from("nixosConfigurations"));
793-
attribute.push(hostname);
791+
attribute.push(hostname_str.to_owned());
794792
}
795793
attribute.extend(toplevel);
796794
},

0 commit comments

Comments
 (0)