apply clippy optimizations

This commit is contained in:
yggverse 2024-11-22 14:52:45 +02:00
parent c5ca74702a
commit 48ad344adc
3 changed files with 4 additions and 13 deletions

View File

@ -42,16 +42,10 @@ impl Form {
let update = action.update.clone(); let update = action.update.clone();
move |item| { move |item| {
// Change name entry visibility // Change name entry visibility
name.show(match item { name.show(matches!(item, Value::GenerateNewAuth));
Value::GenerateNewAuth => true,
_ => false,
});
// Change file choose button visibility // Change file choose button visibility
file.show(match item { file.show(matches!(item, Value::ImportPem));
Value::ImportPem => true,
_ => false,
});
// Update widget // Update widget
update.activate(); update.activate();

View File

@ -67,7 +67,7 @@ impl File {
Ok(file) => match file.path() { Ok(file) => match file.path() {
Some(path) => { Some(path) => {
let filename = path.to_str().unwrap(); let filename = path.to_str().unwrap();
match TlsCertificate::from_file(&filename) { match TlsCertificate::from_file(filename) {
Ok(certificate) => { Ok(certificate) => {
pem.replace(to_pem(certificate)); pem.replace(to_pem(certificate));
gobject.set_css_classes(&["success"]); gobject.set_css_classes(&["success"]);

View File

@ -55,9 +55,6 @@ impl Memory {
result.sort_by(|a, b| b.1.cmp(&a.1)); result.sort_by(|a, b| b.1.cmp(&a.1));
// Get first match ID // Get first match ID
match result.get(0) { result.first().map(|value| value.0)
Some(value) => Some(value.0),
None => None,
}
} }
} }