Skip to content

Commit

Permalink
fix: cargo check warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
spacemeowx2 committed Oct 2, 2024
1 parent 5d74fc4 commit b4487c2
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 15 deletions.
File renamed without changes.
12 changes: 0 additions & 12 deletions protocol/obfs/src/http_simple.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use core::fmt;
use std::{
io::{self, Cursor, Write},
pin::Pin,
Expand Down Expand Up @@ -81,17 +80,6 @@ impl Connect {
}
}

struct UrlEncode<'a>(&'a [u8]);

impl<'a> fmt::Display for UrlEncode<'a> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
for i in self.0 {
write!(f, "%{:02x}", i)?;
}
Ok(())
}
}

#[async_trait]
impl ITcpStream for Connect {
async fn peer_addr(&self) -> Result<std::net::SocketAddr> {
Expand Down
2 changes: 2 additions & 0 deletions rabbit-digger/src/rabbit_digger/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ pub enum EventType {
CloseConnection,
Write(u64),
Read(u64),
#[allow(dead_code)]
SendTo(Address, u64),
#[allow(dead_code)]
RecvFrom(Address, u64),
}

Expand Down
1 change: 0 additions & 1 deletion rd-std/src/builtin/resolve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ use rd_interface::{

type Resolver =
Arc<dyn Fn(String, u16) -> BoxFuture<'static, io::Result<Vec<SocketAddr>>> + Send + Sync>;
pub struct Udp(UdpSocket, Resolver);

// Resolves domain names to IP addresses before connecting.
#[rd_config]
Expand Down
1 change: 1 addition & 0 deletions rd-std/src/rule/rule_net.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ use rd_interface::{
use tracing::instrument;

pub struct RuleItem {
#[allow(dead_code)]
pub target_name: String,
pub target: Net,
matcher: config::Matcher,
Expand Down
1 change: 1 addition & 0 deletions rd-std/src/transparent.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#[cfg(target_os = "linux")]
mod origin_addr;
#[cfg(target_os = "linux")]
mod redir;
Expand Down
2 changes: 0 additions & 2 deletions rd-std/src/transparent/origin_addr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ pub trait OriginAddrExt {
fn origin_addr(&self) -> io::Result<SocketAddr>;
}

#[cfg(target_os = "linux")]
use std::os::unix::prelude::AsRawFd;

#[cfg(target_os = "linux")]
impl<T: AsRawFd> OriginAddrExt for T {
fn origin_addr(&self) -> io::Result<SocketAddr> {
use socket2::SockAddr;
Expand Down

0 comments on commit b4487c2

Please sign in to comment.