mirror of
https://github.com/pcvolkmer/cert-tools.git
synced 2025-09-13 11:12:52 +00:00
chore: simple code cleanup
This commit is contained in:
@@ -114,10 +114,7 @@ impl Ui {
|
|||||||
fn update(&mut self, message: Message) -> Task<Message> {
|
fn update(&mut self, message: Message) -> Task<Message> {
|
||||||
fn fixed_chain(chain: &Option<Chain>) -> Option<Chain> {
|
fn fixed_chain(chain: &Option<Chain>) -> Option<Chain> {
|
||||||
match chain {
|
match chain {
|
||||||
Some(chain) => match Chain::create_fixed(chain.certs()) {
|
Some(chain) => Chain::create_fixed(chain.certs()).ok(),
|
||||||
Ok(chain) => Some(chain),
|
|
||||||
_ => None,
|
|
||||||
},
|
|
||||||
_ => None,
|
_ => None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -139,10 +136,7 @@ impl Ui {
|
|||||||
}
|
}
|
||||||
Message::ClearCaFile => {
|
Message::ClearCaFile => {
|
||||||
self.ca_file = File::None;
|
self.ca_file = File::None;
|
||||||
self.chain = match self.load_chain() {
|
self.chain = self.load_chain().ok();
|
||||||
Ok(chain) => Some(chain),
|
|
||||||
_ => None,
|
|
||||||
};
|
|
||||||
self.fixed_chain = fixed_chain(&self.chain);
|
self.fixed_chain = fixed_chain(&self.chain);
|
||||||
self.chain_indicator_state = self.chain_indicator_state();
|
self.chain_indicator_state = self.chain_indicator_state();
|
||||||
Task::done(Message::Print)
|
Task::done(Message::Print)
|
||||||
@@ -159,10 +153,7 @@ impl Ui {
|
|||||||
Ok(chain) => File::Certificates(file, Box::new(chain)),
|
Ok(chain) => File::Certificates(file, Box::new(chain)),
|
||||||
Err(_) => File::Invalid(file),
|
Err(_) => File::Invalid(file),
|
||||||
};
|
};
|
||||||
self.chain = match self.load_chain() {
|
self.chain = self.load_chain().ok();
|
||||||
Ok(chain) => Some(chain),
|
|
||||||
_ => None,
|
|
||||||
};
|
|
||||||
self.fixed_chain = fixed_chain(&self.chain);
|
self.fixed_chain = fixed_chain(&self.chain);
|
||||||
self.output = Content::default();
|
self.output = Content::default();
|
||||||
self.mode = UiMode::CertList;
|
self.mode = UiMode::CertList;
|
||||||
@@ -179,10 +170,7 @@ impl Ui {
|
|||||||
Ok(chain) => File::Certificates(file, Box::new(chain)),
|
Ok(chain) => File::Certificates(file, Box::new(chain)),
|
||||||
Err(_) => File::Invalid(file),
|
Err(_) => File::Invalid(file),
|
||||||
};
|
};
|
||||||
self.chain = match self.load_chain() {
|
self.chain = self.load_chain().ok();
|
||||||
Ok(chain) => Some(chain),
|
|
||||||
_ => None,
|
|
||||||
};
|
|
||||||
self.fixed_chain = fixed_chain(&self.chain);
|
self.fixed_chain = fixed_chain(&self.chain);
|
||||||
self.output = Content::default();
|
self.output = Content::default();
|
||||||
}
|
}
|
||||||
@@ -770,10 +758,10 @@ impl Ui {
|
|||||||
text("Bitte Passwort für den Export eingeben"),
|
text("Bitte Passwort für den Export eingeben"),
|
||||||
text_input("", &self.password_1)
|
text_input("", &self.password_1)
|
||||||
.secure(true)
|
.secure(true)
|
||||||
.on_input(|t| Message::SetPw1(t)),
|
.on_input(Message::SetPw1),
|
||||||
text_input("", &self.password_2)
|
text_input("", &self.password_2)
|
||||||
.secure(true)
|
.secure(true)
|
||||||
.on_input(|t| Message::SetPw2(t)),
|
.on_input(Message::SetPw2),
|
||||||
row![ok_button, button("Cancel").on_press(Message::Abort)].spacing(4),
|
row![ok_button, button("Cancel").on_press(Message::Abort)].spacing(4),
|
||||||
]
|
]
|
||||||
.spacing(4)
|
.spacing(4)
|
||||||
|
Reference in New Issue
Block a user