diff options
author | Lars Wirzenius <liw@liw.fi> | 2022-09-09 10:05:22 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2022-09-09 10:05:22 +0300 |
commit | 7feb9f78e51c22ffa8c1cec5fed033e689949576 (patch) | |
tree | 36bce045f130b6f1cf1f4b0004a4f69ddc92a821 /src/spec.rs | |
parent | bafcd4242edcac67039b0c12fa33f27445bee03d (diff) | |
download | vmadm-7feb9f78e51c22ffa8c1cec5fed033e689949576.tar.gz |
chore: use unwrap_or instead of more complicated structure
Sponsored-by: author
Diffstat (limited to 'src/spec.rs')
-rw-r--r-- | src/spec.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/spec.rs b/src/spec.rs index 332bf94..5f5a28e 100644 --- a/src/spec.rs +++ b/src/spec.rs @@ -387,7 +387,7 @@ fn ssh_keys(filenames: &[PathBuf]) -> Result<Vec<String>, SpecificationError> { let key = std::fs::read(&filename).map_err(|e| SpecificationError::SshKeyRead(filename, e))?; let key = String::from_utf8(key)?; - let key = key.strip_suffix('\n').or(Some(&key)).unwrap(); + let key = key.strip_suffix('\n').unwrap_or(&key); keys.push(key.to_string()); } Ok(keys) |