Skip to main content

max / quasi

Collapse the passthrough let-chain in the Tauri protocol handler
Author: Max Johnson <me@maxj.phd> · 2026-08-08 23:14 UTC
Signed with PGP, not checked
Commit: 7434f76d74fa4700cb21957a012cf1f42a58c4bf
Parent: 3fe7701
2 files changed, +16 insertions, -16 deletions
M Cargo.lock +8 -8
@@ -4491,14 +4491,6 @@
4491 4491 source = "registry+https://github.com/rust-lang/crates.io-index"
4492 4492 checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b"
4493 4493
4494 - [[patch.unused]]
4495 - name = "synckit-client"
4496 - version = "0.8.0"
4497 -
4498 - [[patch.unused]]
4499 - name = "synckit-config"
4500 - version = "0.2.0"
4501 -
4502 4494 [[patch.unused]]
4503 4495 name = "kberg"
4504 4496 version = "0.1.0"
@@ -4514,3 +4506,11 @@
4514 4506 [[patch.unused]]
4515 4507 name = "docengine"
4516 4508 version = "0.4.0"
4509 +
4510 + [[patch.unused]]
4511 + name = "synckit-client"
4512 + version = "0.8.0"
4513 +
4514 + [[patch.unused]]
4515 + name = "synckit-config"
4516 + version = "0.2.0"
@@ -283,14 +283,14 @@
283 283 {
284 284 let path = request.uri().path();
285 285
286 - if let Some(passthrough) = context.passthrough.as_ref() {
287 - if let Some(served) = passthrough(path) {
288 - return http::Response::builder()
289 - .status(200)
290 - .header(http::header::CONTENT_TYPE, served.content_type)
291 - .body(served.body)
292 - .unwrap_or_else(|_| quasi_http::refuse(Refusal::Malformed));
293 - }
286 + if let Some(passthrough) = context.passthrough.as_ref()
287 + && let Some(served) = passthrough(path)
288 + {
289 + return http::Response::builder()
290 + .status(200)
291 + .header(http::header::CONTENT_TYPE, served.content_type)
292 + .body(served.body)
293 + .unwrap_or_else(|_| quasi_http::refuse(Refusal::Malformed));
294 294 }
295 295
296 296 let incoming = match quasi_http::decode(