mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-03-10 20:51:45 +00:00
apply clippy optimizations
This commit is contained in:
parent
c5ca74702a
commit
48ad344adc
@ -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();
|
||||
|
@ -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"]);
|
||||
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user