Skip to content

Commit

Permalink
Merge pull request #3 from ohkami-rs/chore/allow-lint-to-cfg-feature
Browse files Browse the repository at this point in the history
chore: avoid `#[allow(unreachable_patterns)]` and use `#[cfg(...)]`
  • Loading branch information
kanarus authored Oct 25, 2024
2 parents d804947 + 28abe11 commit 0aa7a42
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 6 deletions.
3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ http1_glommio = ["http1", "rt_glommio"]

### DEBUG ###
DEBUG = []
DEV = ["DEBUG", "sse", "ws", "http1", "rt_tokio"]
DOCTEST = ["DEV", "tokio?/full"]
DEV = ["DEBUG", "sse", "ws", "http1", "rt_tokio", "tokio?/full"]
### default = ["DEV"]

[dev-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ tasks:

test:doc:
cmds:
- cargo test --doc --features DOCTEST
- cargo test --doc --features DEV

test:default:
cmds:
Expand Down
2 changes: 1 addition & 1 deletion src/http1/send.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const _: () = {
#[cfg(feature="ws")]
(Upgrade::WebSocket(_), Upgrade::WebSocket(_)) => true,

#[allow(unreachable_patterns)]
#[cfg(feature="ws")]
_ => false
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/response/body.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ impl PartialEq for Body {
#[cfg(feature="ws")]
(Body::WebSocket(_), Body::WebSocket(_)) => false/* can't compare */,

#[allow(unreachable_patterns)]
#[cfg(any(feature="sse", feature="ws"))]
_ => false
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/response/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ impl Response {
match self.body()? {
Body::Payload(p) => Some(p),

#[allow(unreachable_patterns)]
#[cfg(any(feature="sse", feature="ws"))]
_ => None
}
}
Expand Down

0 comments on commit 0aa7a42

Please sign in to comment.