From f4c581b786ec58f9526a5fa94f9f6be1edfffefd Mon Sep 17 00:00:00 2001 From: Mydayyy Date: Tue, 24 Feb 2026 23:17:19 +0100 Subject: [PATCH 1/2] fix: remove unnecessary unwrap --- src/main.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index 640fc6c..3ca6e72 100644 --- a/src/main.rs +++ b/src/main.rs @@ -68,10 +68,8 @@ fn handle_get(opts: &Opts) -> PbResult<()> { } } - if content.attachment.is_some() && opts.download.is_some() { - let attachment = content.attachment.as_ref().unwrap(); - let outfile = opts.download.as_ref().unwrap(); - + if let (Some(attachment), Some(outfile)) = (content.attachment.as_ref(), opts.download.as_ref()) + { let url = DataUrl::process(attachment)?; let (body, _) = url.decode_to_vec().unwrap(); From 535a4403b185b72f434bec755da6d23dd5620b72 Mon Sep 17 00:00:00 2001 From: Mydayyy Date: Tue, 24 Feb 2026 23:22:46 +0100 Subject: [PATCH 2/2] fix: formatting --- src/api.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/api.rs b/src/api.rs index 53418d0..49d7f84 100644 --- a/src/api.rs +++ b/src/api.rs @@ -140,11 +140,9 @@ fn pem_certs_from_bundle(pem: &[u8]) -> PbResult> { } else if line.contains("END CERTIFICATE") { current.push_str(line); current.push('\n'); - certs.push( - Certificate::from_pem(current.as_bytes()).map_err(|e| { - PbError::InvalidCertificate(format!("invalid certificate in bundle: {}", e)) - })?, - ); + certs.push(Certificate::from_pem(current.as_bytes()).map_err(|e| { + PbError::InvalidCertificate(format!("invalid certificate in bundle: {}", e)) + })?); in_cert = false; } else if in_cert { current.push_str(line);