This commit is contained in:
Edward Shen 2022-01-11 23:50:07 -08:00
parent 1fca1c51e4
commit 4c7ae4feb2
Signed by: edward
GPG key ID: 19182661E818369F

View file

@ -89,13 +89,12 @@ fn main() {
};
let (key, needs_pw) = {
let fragment = match url.split_once('#').map(|(_, fragment)| fragment) {
Some(fragment) => fragment,
None => {
error!("Key is missing in url; bailing.");
render_message("Invalid paste link: Missing decryption key.".into());
return;
}
let fragment = if let Some(fragment) = url.split_once('#').map(|(_, fragment)| fragment) {
fragment
} else {
error!("Key is missing in url; bailing.");
render_message("Invalid paste link: Missing decryption key.".into());
return;
};
let partial_parsed_url = match PartialParsedUrl::try_from(fragment) {