Skip to content
This repository was archived by the owner on Jan 25, 2024. It is now read-only.

Commit 89f51c6

Browse files
committed
Simplify type of handle_request
1 parent 19dbed5 commit 89f51c6

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/main.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -135,11 +135,7 @@ impl App {
135135
let id = req.id.clone();
136136
match self.conn.handle_shutdown(&req) {
137137
Ok(true) => break,
138-
Ok(false) => {
139-
if let Err(err) = self.handle_request(req) {
140-
self.err(id, err);
141-
}
142-
}
138+
Ok(false) => self.handle_request(req),
143139
Err(err) => {
144140
// This only fails if a shutdown was
145141
// requested in the first place, so it
@@ -157,7 +153,7 @@ impl App {
157153
}
158154
}
159155
}
160-
fn handle_request(&mut self, req: Request) -> Result<(), Error> {
156+
fn handle_request(&mut self, req: Request) {
161157
fn cast<Kind>(req: &mut Option<Request>) -> Option<(RequestId, Kind::Params)>
162158
where
163159
Kind: RequestTrait,
@@ -223,7 +219,6 @@ impl App {
223219
format!("Unhandled method {}", req.method),
224220
))
225221
}
226-
Ok(())
227222
}
228223
fn handle_notification(&mut self, req: Notification) -> Result<(), Error> {
229224
match &*req.method {

0 commit comments

Comments
 (0)