mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-03-11 13:11:08 +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();
|
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();
|
||||||
|
@ -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"]);
|
||||||
|
@ -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,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user