Skip to content

Commit 5415e94

Browse files
authored
chore: make use of Req import consistent (#13)
* chore: make use of Req import consistent * chore: remove newline
1 parent f95a9ed commit 5415e94

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/axum.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
use crate::{types::Response, HandlerArgs};
1+
use crate::{
2+
types::{Request, Response},
3+
HandlerArgs,
4+
};
25
use axum::{extract::FromRequest, response::IntoResponse};
36
use bytes::Bytes;
47
use std::{future::Future, pin::Pin};
@@ -15,7 +18,7 @@ where
1518
return Box::<str>::from(Response::parse_error()).into_response();
1619
};
1720

18-
let Ok(req) = crate::types::Request::try_from(bytes) else {
21+
let Ok(req) = Request::try_from(bytes) else {
1922
return Box::<str>::from(Response::parse_error()).into_response();
2023
};
2124

src/routes/ctx.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1+
use crate::{types::Request, RpcSend};
12
use serde_json::value::RawValue;
23
use tokio::sync::mpsc;
34
use tracing::error;
45

5-
use crate::RpcSend;
6-
76
/// Errors that can occur when sending notifications.
87
#[derive(thiserror::Error, Debug)]
98
pub enum NotifyError {
@@ -82,5 +81,5 @@ pub struct HandlerArgs {
8281
/// The handler context.
8382
pub ctx: HandlerCtx,
8483
/// The JSON-RPC request.
85-
pub req: crate::types::Request,
84+
pub req: Request,
8685
}

0 commit comments

Comments
 (0)