Skip to content

Commit f5ab26b

Browse files
committed
tree: fix lint warnings
Signed-off-by: Antoine Tenart <[email protected]>
1 parent 86021b0 commit f5ab26b

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

Diff for: src/config.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ pub(crate) struct Route {
155155
/// this route. If 'allow' is used, all non-matching addresses are denied.
156156
/// A 'deny' rule wins over an 'allow' one and the most specific subnet
157157
/// takes precedence.
158-
158+
///
159159
/// Denied IP ranges. If a request matches, it'll be denied.
160160
///
161161
/// For how allowed ranges compare to denied ones, see `allowed_ranges`.

Diff for: src/http.rs

+6-7
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,12 @@ pub(crate) fn is_http<R: Read>(rb: &ReaderBuf<R>) -> bool {
1818
// fine.
1919
let buf = rb.buf();
2020
if buf.len() >= 5 {
21-
if let Ok(method) = str::from_utf8(&buf[..5]) {
22-
match method {
23-
// From https://developer.mozilla.org/fr/docs/Web/HTTP/Methods
24-
"GET /" | "HEAD " | "POST " | "PUT /" | "DELET" | "CONNE" | "OPTIO" | "TRACE"
25-
| "PATCH" => return true,
26-
_ => (),
27-
}
21+
// From https://developer.mozilla.org/fr/docs/Web/HTTP/Methods
22+
if let Ok(
23+
"GET /" | "HEAD " | "POST " | "PUT /" | "DELET" | "CONNE" | "OPTIO" | "TRACE" | "PATCH",
24+
) = str::from_utf8(&buf[..5])
25+
{
26+
return true;
2827
}
2928
}
3029
false

0 commit comments

Comments
 (0)