Skip to content

Commit 3bfce6c

Browse files
committed
🩹 Fix clippy errors
1 parent 9fe9bb5 commit 3bfce6c

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/error.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,8 @@ impl Error {
102102
error_with_source! {pub(crate) BotEventMismatch}
103103
error_with_source! {pub(crate) ReadBodyFailed}
104104
error_with_source! {pub(crate) ParseBodyFailed}
105-
error_with_source! {pub(crate) Handler}
105+
// cfg(not(feature = "tower")) でdead_codeになる
106+
error_with_source! {#[allow(dead_code)] pub(crate) Handler}
106107
}
107108

108109
impl From<ErrorKind> for Error {

src/handler.rs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ where
4343

4444
#[must_use]
4545
#[derive(Debug, Clone, Copy, Default, Hash)]
46-
pub struct HandlerSink;
46+
pub struct Sink;
4747

48-
impl<T> Service<T> for HandlerSink {
48+
impl<T> Service<T> for Sink {
4949
type Response = ();
5050
type Error = Infallible;
5151
type Future = ReadyFuture<Result<(), Infallible>>;
@@ -76,9 +76,9 @@ macro_rules! all_event_service {
7676
all_events! {all_event_service}
7777

7878
impl RequestParser {
79-
pub fn into_handler(self) -> Handler<HandlerSink> {
79+
pub fn into_handler(self) -> Handler<Sink> {
8080
Handler {
81-
service: HandlerSink,
81+
service: Sink,
8282
parser: self,
8383
}
8484
}
@@ -122,12 +122,11 @@ where
122122
std::mem::swap(self, &mut s);
123123
Box::pin(async move {
124124
let event = s.parser.parse_request(req).await?;
125-
let _ = s.service.call(event).await.map_err(Error::handler)?;
126-
let res = Response::builder()
125+
s.service.call(event).await.map_err(Error::handler)?;
126+
Response::builder()
127127
.status(StatusCode::NO_CONTENT)
128128
.body(String::new())
129-
.map_err(Error::handler)?;
130-
Ok(res)
129+
.map_err(Error::handler)
131130
})
132131
}
133132
}

0 commit comments

Comments
 (0)