aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/main.rs b/src/main.rs
index c9b80ab..02ee9d9 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -21,7 +21,7 @@ use rocket::{
Request, Response,
};
use state::{AdInfo, Config, Logic};
-use std::{env::args, fs::read_to_string, io::Cursor, net::IpAddr, sync::Arc};
+use std::{env::args, fs::read_to_string, io::Cursor, net::IpAddr};
use tool::tool_main;
fn main() -> anyhow::Result<()> {
@@ -64,16 +64,16 @@ fn main() -> anyhow::Result<()> {
}
}
- let state = Logic::new(config);
-
tokio::runtime::Builder::new_multi_thread()
.enable_all()
.build()?
- .block_on(inner_main(state));
+ .block_on(inner_main(config));
Ok(())
}
-async fn inner_main(state: Arc<Logic>) {
+
+async fn inner_main(config: Config) {
+ let state = Logic::new(config);
let _ = rocket::build()
.configure(rocket::Config {
port: state.config.port,