Skip to content

Commit

Permalink
fix: remove Arc on Tree
Browse files Browse the repository at this point in the history
  • Loading branch information
fundon committed Dec 30, 2023
1 parent cb27f98 commit f33585b
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 27 deletions.
48 changes: 24 additions & 24 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,30 @@ members = [
"viz-test",

"examples/hello-world",
"examples/unix-socket",
"examples/static-files/embed",
"examples/static-files/serve",
"examples/static-files/include-dir",
"examples/limits",
"examples/forms/form",
"examples/forms/multipart",
"examples/websocket-chat",
"examples/sse",
"examples/session",
"examples/csrf",
"examples/cors",
"examples/rustls",
"examples/static-routes",
"examples/routing/todos",
"examples/routing/openapi",
"examples/otel/*",
"examples/compression",
"examples/templates/*",
"examples/tracing",
"examples/graceful-shutdown",
"examples/databases/*",
"examples/htmlx",
"examples/tower",
# "examples/unix-socket",
# "examples/static-files/embed",
# "examples/static-files/serve",
# "examples/static-files/include-dir",
# "examples/limits",
# "examples/forms/form",
# "examples/forms/multipart",
# "examples/websocket-chat",
# "examples/sse",
# "examples/session",
# "examples/csrf",
# "examples/cors",
# "examples/rustls",
# "examples/static-routes",
# "examples/routing/todos",
# "examples/routing/openapi",
# "examples/otel/*",
# "examples/compression",
# "examples/templates/*",
# "examples/tracing",
# "examples/graceful-shutdown",
# "examples/databases/*",
# "examples/htmlx",
# "examples/tower",
]

[workspace.package]
Expand Down
6 changes: 3 additions & 3 deletions viz-test/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use reqwest::Client;
use std::{net::SocketAddr, sync::Arc};
use std::net::SocketAddr;
use tokio::net::TcpListener;
use viz::{serve, Error, Result, Router, Tree};

Expand All @@ -22,7 +22,7 @@ impl TestServer {
/// Will return `Err` if the server fails to start.
pub async fn new(router: Router) -> Result<Self> {
let listener = TcpListener::bind("127.0.0.1:0").await?;
let tree = Arc::new(Tree::from(router));
let tree = Tree::from(router);
let addr = listener.local_addr()?;
let client = reqwest::Client::builder()
.redirect(reqwest::redirect::Policy::none())
Expand Down Expand Up @@ -60,7 +60,7 @@ impl TestServer {
}
}

async fn run(listener: TcpListener, tree: Arc<Tree>) -> Result<()> {
async fn run(listener: TcpListener, tree: Tree) -> Result<()> {
loop {
let (stream, addr) = listener.accept().await?;
let tree = tree.clone();
Expand Down

0 comments on commit f33585b

Please sign in to comment.