diff options
author | Lars Wirzenius <liw@liw.fi> | 2021-03-25 11:18:33 +0000 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2021-03-25 11:18:33 +0000 |
commit | 228758b795b3c27d5fd146e380774b29db73432f (patch) | |
tree | 20df497a743e8442f9725c2f5ab552747363a9d1 /src/sshkeys.rs | |
parent | a45450a42e4cdcd7f2d5671984c9c7f3945131fd (diff) | |
parent | 00dc4a7a85b32c4337dd3672adec2cbfe3597bfe (diff) | |
download | vmadm-228758b795b3c27d5fd146e380774b29db73432f.tar.gz |
Merge branch 'tilde' into 'main'
test: don't hide clippy output if it's successful
See merge request larswirzenius/vmadm!30
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(); |