Skip to content

Commit

Permalink
Clippy nits while hacking around (#737)
Browse files Browse the repository at this point in the history
* clippy: unnecessary guard

* create merge nix config clippy nit, old

* Clean up a clippy nit on an extra clone

* clippy nit legacy wsl detection error
  • Loading branch information
grahamc authored Nov 22, 2023
1 parent df9610e commit 41a96f4
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/action/base/create_or_merge_nix_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ impl Action for CreateOrMergeNixConfig {
new_config
.push_str("# Generated by https://github.com/DeterminateSystems/nix-installer.\n");
new_config.push_str("# See `/nix/nix-installer --version` for the version details.\n");
new_config.push_str("\n");
new_config.push('\n');

for (name, value) in merged_nix_config.settings() {
new_config.push_str(name);
Expand Down
2 changes: 1 addition & 1 deletion src/action/common/configure_init_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ impl Action for ConfigureInitService {
#[cfg(target_os = "macos")]
InitSystem::Launchd => {
let src = std::path::Path::new(DARWIN_NIX_DAEMON_SOURCE);
tokio::fs::copy(src.clone(), DARWIN_NIX_DAEMON_DEST)
tokio::fs::copy(src, DARWIN_NIX_DAEMON_DEST)
.await
.map_err(|e| {
Self::error(ActionErrorKind::Copy(
Expand Down
2 changes: 1 addition & 1 deletion src/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ pub fn diagnostic_endpoint_parser(input: &str) -> Result<Option<Url>, Diagnostic
"https" | "http" | "file" => Ok(Some(v)),
_ => Err(DiagnosticError::UnknownUrlScheme),
},
Err(url_error) if url_error == url::ParseError::RelativeUrlWithoutBase => {
Err(url::ParseError::RelativeUrlWithoutBase) => {
match Url::parse(&format!("file://{input}")) {
Ok(v) => Ok(Some(v)),
Err(file_error) => Err(file_error)?,
Expand Down
4 changes: 2 additions & 2 deletions src/planner/linux.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,9 @@ pub(crate) async fn check_nix_not_already_installed() -> Result<(), PlannerError
pub(crate) fn check_systemd_active() -> Result<(), PlannerError> {
if !Path::new("/run/systemd/system").exists() {
if std::env::var("WSL_DISTRO_NAME").is_ok() {
return Err(LinuxErrorKind::Wsl2SystemdNotActive)?;
return Err(LinuxErrorKind::Wsl2SystemdNotActive.into());
} else {
return Err(LinuxErrorKind::SystemdNotActive)?;
return Err(LinuxErrorKind::SystemdNotActive.into());
}
}

Expand Down

0 comments on commit 41a96f4

Please sign in to comment.