1
0
Fork 0
mirror of https://gitlab.com/hagrid-keyserver/hagrid.git synced 2023-02-13 20:55:02 -05:00

lint: fix clippy::single_match

This commit is contained in:
Nora Widdecke 2022-02-18 14:12:55 +01:00
parent a46bd4ebee
commit 4d27f3f5b9
2 changed files with 14 additions and 23 deletions

View file

@ -529,21 +529,15 @@ impl Database for Filesystem {
let expected = diff_paths(&self.fingerprint_to_path_published(primary_fpr),
link_fpr.parent().unwrap()).unwrap();
match read_link(&link_fpr) {
Ok(target) => {
if target == expected {
remove_file(&link_fpr)?;
}
if let Ok(target) = read_link(&link_fpr) {
if target == expected {
remove_file(&link_fpr)?;
}
Err(_) => {}
}
match read_link(&link_keyid) {
Ok(target) => {
if target == expected {
remove_file(link_keyid)?;
}
if let Ok(target) = read_link(&link_keyid) {
if target == expected {
remove_file(link_keyid)?;
}
Err(_) => {}
}
Ok(())

View file

@ -346,17 +346,14 @@ pub async fn process_post_form(
not valid"))
})?;
match name.to_string().as_str() {
"keytext" => {
return Ok(vks::process_key(
db,
i18n,
tokens_stateless,
rate_limiter,
Cursor::new(decoded_value.as_bytes())
));
}
_ => { /* skip */ }
if name.to_string().as_str() == "keytext" {
return Ok(vks::process_key(
db,
i18n,
tokens_stateless,
rate_limiter,
Cursor::new(decoded_value.as_bytes())
));
}
}