Skip to content

Commit e7dd855

Browse files
committed
refactor: improve import statements by using type aliases for clarity
1 parent 3d5e3bb commit e7dd855

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/codec.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
use crate::errors::{KodeBridgeError, Result};
22
use crate::ipc_http_server::HttpResponse;
3-
use bytes::{BufMut, Bytes, BytesMut};
3+
use bytes::{BufMut as _, Bytes, BytesMut};
44
use http::{HeaderMap, Method, Uri};
55
use httparse::{Request, Status};
6-
use std::io::Write;
6+
use std::io::Write as _;
77
use tokio_util::codec::{Decoder, Encoder};
88

99
/// Codec for HTTP over IPC
@@ -97,7 +97,8 @@ impl Decoder for HttpIpcCodec {
9797
// We need new headers array because the previous one was for the slice
9898
let mut headers = vec![httparse::EMPTY_HEADER; 64];
9999
let mut req = Request::new(&mut headers);
100-
let status = req.parse(&data).unwrap(); // Should succeed
100+
let status = req.parse(&data)?;
101+
#[allow(clippy::unwrap_used)]
101102
let body_start = status.unwrap();
102103

103104
let method = req

src/ipc_http_server.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
use crate::codec::HttpIpcCodec;
77
use crate::errors::{KodeBridgeError, Result};
88
use bytes::Bytes;
9-
use futures::{SinkExt, StreamExt};
9+
use futures::{SinkExt as _, StreamExt as _};
1010
use http::{HeaderMap, Method, StatusCode, Uri};
1111
use interprocess::local_socket::{
1212
tokio::prelude::LocalSocketStream, traits::tokio::Listener as _, GenericFilePath, ListenerOptions, Name,

0 commit comments

Comments
 (0)