Skip to content

Commit 38c617d

Browse files
committed
style: 优化代码格式和导入顺序,移除未使用的文档
1 parent 103cd02 commit 38c617d

File tree

6 files changed

+6
-27
lines changed

6 files changed

+6
-27
lines changed

deny.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ exceptions = [
117117
# Each entry is the crate and version constraint, and its specific allow
118118
# list
119119
#{ allow = ["Zlib"], crate = "adler32" },
120+
{ allow = ["CDLA-Permissive-2.0"], crate = "webpki-root-certs" },
120121
]
121122

122123
# Some crates don't have (easily) machine readable licensing information,

docs/requirements/quic-example.md

Lines changed: 0 additions & 20 deletions
This file was deleted.

examples/quic/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use anyhow::{Result, anyhow};
2-
use silent::prelude::*;
32
use silent::QuicEndpointListener;
3+
use silent::prelude::*;
44
use tracing_subscriber::EnvFilter;
55

66
#[tokio::main]

silent/src/quic/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![cfg(feature = "quic")]
2-
31
pub(crate) mod connection;
42
mod core;
53
mod echo;

silent/src/quic/service.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ pub(crate) async fn handle_quic_connection(
2828
info!(%remote, "客户端连接建立");
2929

3030
// 默认的 WebTransport Handler
31-
let handler = Arc::new(super::echo::EchoHandler::default());
31+
let handler = Arc::new(super::echo::EchoHandler);
3232

3333
let mut builder = h3::server::builder();
3434
builder

silent/src/service/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,16 @@ impl ConnectionService for Route {
5454
Ok(quic) => {
5555
// QUIC 连接处理
5656
let routes = Arc::new(self.clone());
57-
return Box::pin(async move {
57+
Box::pin(async move {
5858
let incoming = quic.into_incoming();
5959
crate::quic::service::handle_quic_connection(incoming, routes)
6060
.await
6161
.map_err(BoxError::from)
62-
});
62+
})
6363
}
6464
Err(stream) => {
6565
// 不是 QUIC 连接,继续处理为 HTTP/1.1 或 HTTP/2
66-
return Self::handle_http_connection(self.clone(), stream, peer);
66+
Self::handle_http_connection(self.clone(), stream, peer)
6767
}
6868
}
6969
}

0 commit comments

Comments
 (0)