From ee3d680a3f8e286ab760ff7e20ba9873d3b0b448 Mon Sep 17 00:00:00 2001 From: Tarunvir Bains Date: Fri, 28 Nov 2025 18:04:28 -0700 Subject: [PATCH] fix(compiler): Refactor let-chains for stable rustc compatibility The previous implementation used the unstable 'let_chains' feature, which caused compilation to fail on stable Rust toolchains. This commit refactors the code to use nested 'if let' statements instead, which is compatible with stable Rust and achieves the same logic. This change fixes the build on the stable Rust release channel. --- src/matchers.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/matchers.rs b/src/matchers.rs index b9650dc..c778724 100644 --- a/src/matchers.rs +++ b/src/matchers.rs @@ -211,15 +211,15 @@ impl PathExactMatcher { ); } - if let Ok(url) = Url::parse(&path) - && let Some(host) = url.host_str() - { - panic!( - "Wiremock can't match the path `{}` because it contains the host `{}`. You don't have to specify the host - wiremock knows it. Try replacing your path with `path(\"{}\")`", - path, - host, - url.path() - ); + if let Ok(url) = Url::parse(&path) { + if let Some(host) = url.host_str() { + panic!( + "Wiremock can't match the path `{}` because it contains the host `{}`. You don't have to specify the host - wiremock knows it. Try replacing your path with `path(\"{}\")`", + path, + host, + url.path() + ); + } } // Prepend "/" to the path if missing.