diff options
Diffstat (limited to 'src/parse_host_port.rs')
-rw-r--r-- | src/parse_host_port.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/parse_host_port.rs b/src/parse_host_port.rs index e7d65c0..ae4a278 100644 --- a/src/parse_host_port.rs +++ b/src/parse_host_port.rs @@ -121,6 +121,11 @@ impl State{ fn next_percent_encoded_character(state: Shared, c: char) -> Result<Self, Error> { let mut state = state; + // We can't use `Option::map_or` (or `Option::map_or_else`, for similar + // reasons) in this case because the closure would take ownership of + // `state`, preventing it from being used to construct the default + // value. + #[allow(clippy::option_if_let_else)] if let Some(ci) = state.pec_decoder.next(c)? { state.host.push(ci); Ok(Self::NotIpLiteral(state)) |