summaryrefslogtreecommitdiff
path: root/src/sshkeys.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/sshkeys.rs')
-rw-r--r--src/sshkeys.rs8
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();