master
Edward Shen 2022-01-11 23:50:07 -08:00
parent 1fca1c51e4
commit 4c7ae4feb2
Signed by: edward
GPG Key ID: 19182661E818369F
1 changed files with 6 additions and 7 deletions

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) {