diff --git a/server/src/bootstrapper/builder.rs b/server/src/bootstrapper/builder.rs index 6222d4e..c57dc8e 100644 --- a/server/src/bootstrapper/builder.rs +++ b/server/src/bootstrapper/builder.rs @@ -1,9 +1,10 @@ -use std::fs::OpenOptions; +use crate::{ + bootstrapper::bootstrapper::Bootstrapper, config_manager::get_args, +}; use actix::{Actor, Addr}; use clap::ArgMatches; +use std::fs::OpenOptions; use tokio::fs::File; -use crate::bootstrapper::bootstrapper::Bootstrapper; -use super::get_args; pub struct Builder { pub(super) args: ArgMatches, @@ -11,9 +12,7 @@ pub struct Builder { impl Builder { pub(super) fn new() -> Self { - Self { - args: get_args(), - } + Self { args: get_args() } } pub fn file(mut self, path: String) -> Self { @@ -22,7 +21,8 @@ impl Builder { .write(true) .read(true) .open(path) - .ok().map(|val| File::from(val)); + .ok() + .map(|val| File::from(val)); self } @@ -30,4 +30,4 @@ impl Builder { pub fn build(self) -> Addr { Bootstrapper::from(self).start() } -} \ No newline at end of file +} diff --git a/server/src/bootstrapper/mod.rs b/server/src/bootstrapper/mod.rs index 98780b3..862d9cf 100644 --- a/server/src/bootstrapper/mod.rs +++ b/server/src/bootstrapper/mod.rs @@ -1,7 +1,5 @@ mod bootstrapper; mod builder; mod messages; -mod arg_fetcher; -pub(crate) use arg_fetcher::get_args; -pub(crate) use bootstrapper::Bootstrapper; \ No newline at end of file +pub(crate) use bootstrapper::Bootstrapper; diff --git a/server/src/bootstrapper/arg_fetcher.rs b/server/src/config_manager/arg_fetcher.rs similarity index 100% rename from server/src/bootstrapper/arg_fetcher.rs rename to server/src/config_manager/arg_fetcher.rs diff --git a/server/src/main.rs b/server/src/main.rs index cbc057e..860cb66 100644 --- a/server/src/main.rs +++ b/server/src/main.rs @@ -3,28 +3,25 @@ //! It starts the actor runtime and then sleeps //! for the duration of the program. -pub(crate) mod server; +pub(crate) mod bootstrapper; pub(crate) mod client_management; +pub(crate) mod config_manager; +pub(crate) mod lua; pub(crate) mod network; pub(crate) mod prelude; pub(crate) mod rhai; -pub(crate) mod lua; pub(crate) mod scripting; -pub(crate) mod bootstrapper; -pub(crate) mod config_manager; +pub(crate) mod server; + +use crate::bootstrapper::Bootstrapper; -use std::env::args; -use actix::Actor; use server::Server; + use tokio::time::{sleep, Duration}; -use clap::{App, Arg, value_parser}; -use openssl::version::version; -use crate::bootstrapper::{Bootstrapper, get_args}; #[actix::main()] async fn main() { - let init = Bootstrapper::create() - .build(); + let init = Bootstrapper::create().build(); loop { sleep(Duration::from_millis(1000)).await; }