diff options
author | Lars Wirzenius <liw@liw.fi> | 2021-03-25 12:50:07 +0200 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2021-03-25 13:16:01 +0200 |
commit | 7d906d7f5436705ec3f2f3f5c4d8629c79f98fde (patch) | |
tree | c76e54aeed34d49afd4b020653ebaf1ea7c50e9e /src/sshkeys.rs | |
parent | a70d80b9cc5fb1b2487339bdef4152796ed2ff8d (diff) | |
download | vmadm-7d906d7f5436705ec3f2f3f5c4d8629c79f98fde.tar.gz |
refactor: clean up warnings found by clippy
Diffstat (limited to 'src/sshkeys.rs')
-rw-r--r-- | src/sshkeys.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/sshkeys.rs b/src/sshkeys.rs index 349cabe..b6a5dd9 100644 --- a/src/sshkeys.rs +++ b/src/sshkeys.rs @@ -110,7 +110,7 @@ impl KeyPair { /// Generate a new key pair of the desired kind. pub fn generate(kind: KeyKind) -> Result<Self, KeyError> { - let dirname = tempdir().map_err(|err| KeyError::TempDir(err))?; + let dirname = tempdir().map_err(KeyError::TempDir)?; let private_key = dirname.path().join("key"); let output = Command::new("ssh-keygen") .arg("-f") @@ -122,7 +122,7 @@ impl KeyPair { .arg("-N") .arg("") .output() - .map_err(|err| KeyError::Run(err))?; + .map_err(KeyError::Run)?; if !output.status.success() { let stderr = String::from_utf8_lossy(&output.stderr).into_owned(); @@ -178,7 +178,7 @@ impl CaKey { /// /// Return as a string. pub fn certify_host(&self, host_key: &KeyPair, hostname: &str) -> Result<String, KeyError> { - let dirname = tempdir().map_err(|err| KeyError::TempDir(err))?; + let dirname = tempdir().map_err(KeyError::TempDir)?; let ca_key = dirname.path().join("ca"); let host_key_pub = dirname.path().join("host.pub"); let cert = dirname.path().join("host-cert.pub"); @@ -196,7 +196,7 @@ impl CaKey { .arg(format!("host key for {}", hostname)) .arg(&host_key_pub) .output() - .map_err(|err| KeyError::Run(err))?; + .map_err(KeyError::Run)?; if !output.status.success() { let stderr = String::from_utf8_lossy(&output.stderr).into_owned(); |