Skip to content

Conversation

@TarunvirBains
Copy link

@TarunvirBains TarunvirBains commented Nov 29, 2025

The previous implementation used the unstable 'let_chains' && syntax, which caused compilation to fail on current Rust toolchains, in particular Rust 1.85.

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.

Here is the compile message from the current main branch when I attempt to compile it:

error[E0658]: `let` expressions in this position are unstable
   --> src/matchers.rs:214:12
    |
214 |         if let Ok(url) = Url::parse(&path)
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: see issue #53667 <https://github.com/rust-lang/rust/issues/53667> for more information

error[E0658]: `let` expressions in this position are unstable
   --> src/matchers.rs:215:16
    |
215 |             && let Some(host) = url.host_str()
    |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: see issue #53667 <https://github.com/rust-lang/rust/issues/53667> for more information

For more information about this error, try `rustc --explain E0658.
error: could not compile `wiremock` (lib) due to 2 previous errors
rustc --version
rustc 1.85.0 (4d91de4e4 2025-02-17)

This PR fixes the issue with the correct stable syntax`

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant