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();
move |item| {
// Change name entry visibility
name.show(match item {
Value::GenerateNewAuth => true,
_ => false,
});
name.show(matches!(item, Value::GenerateNewAuth));
// Change file choose button visibility
file.show(match item {
Value::ImportPem => true,
_ => false,
});
file.show(matches!(item, Value::ImportPem));
// Update widget
update.activate();

View File

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

View File

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