aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFuwn <[email protected]>2021-05-17 10:16:42 +0000
committerFuwn <[email protected]>2021-05-17 10:16:42 +0000
commit1b482ab22031ab9a895b2567ba10a2e553752303 (patch)
treedb4874c46b25655ba7c94b0ab435fdb0d681af55
parentrefactor(global): whirl_config modulized (diff)
downloadwhirl-1b482ab22031ab9a895b2567ba10a2e553752303.tar.xz
whirl-1b482ab22031ab9a895b2567ba10a2e553752303.zip
refactor(global): even more modules becoming crates
I did multiple checks and **yes**, everything still works perfectly fine.
-rw-r--r--CONTRIBUTING.md3
-rw-r--r--Cargo.toml65
-rw-r--r--whirl_core/Cargo.toml64
-rw-r--r--whirl_core/src/api/mod.rs (renamed from src/api/mod.rs)0
-rw-r--r--whirl_core/src/api/routes/mod.rs (renamed from src/api/routes/mod.rs)0
-rw-r--r--whirl_core/src/api/routes/stats/mod.rs (renamed from src/api/routes/stats/mod.rs)0
-rw-r--r--whirl_core/src/api/routes/stats/structures.rs (renamed from src/api/routes/stats/structures.rs)0
-rw-r--r--whirl_core/src/cli.rs (renamed from src/cli.rs)0
-rw-r--r--whirl_core/src/db/mod.rs (renamed from src/db/mod.rs)0
-rw-r--r--whirl_core/src/db/models.rs (renamed from src/db/models.rs)0
-rw-r--r--whirl_core/src/db/schema.rs (renamed from src/db/schema.rs)0
-rw-r--r--whirl_core/src/lib.rs (renamed from src/lib.rs)4
-rw-r--r--whirl_core/src/main.rs (renamed from src/main.rs)2
-rw-r--r--whirl_core/src/subs.rs (renamed from src/subs.rs)14
-rw-r--r--whirl_core/src/utils/log.rs (renamed from src/utils/log.rs)0
-rw-r--r--whirl_core/src/utils/mod.rs (renamed from src/utils/mod.rs)0
-rw-r--r--whirl_core/src/utils/sort.rs (renamed from src/utils/sort.rs)0
-rw-r--r--whirl_core/src/utils/system.rs (renamed from src/utils/system.rs)0
-rw-r--r--whirl_prompt/Cargo.toml25
-rw-r--r--whirl_prompt/src/builtins.rs (renamed from src/prompt/builtins.rs)0
-rw-r--r--whirl_prompt/src/lib.rs (renamed from src/prompt/mod.rs)4
-rw-r--r--whirl_prompt/src/structure.rs (renamed from src/prompt/structure.rs)0
-rw-r--r--whirl_server/Cargo.toml37
-rw-r--r--whirl_server/src/cmd/commands/action.rs (renamed from src/server/cmd/commands/action.rs)0
-rw-r--r--whirl_server/src/cmd/commands/buddy_list.rs (renamed from src/server/cmd/commands/buddy_list.rs)2
-rw-r--r--whirl_server/src/cmd/commands/mod.rs (renamed from src/server/cmd/commands/mod.rs)0
-rw-r--r--whirl_server/src/cmd/commands/property/create.rs (renamed from src/server/cmd/commands/property/create.rs)2
-rw-r--r--whirl_server/src/cmd/commands/property/mod.rs (renamed from src/server/cmd/commands/property/mod.rs)0
-rw-r--r--whirl_server/src/cmd/commands/property/parse.rs (renamed from src/server/cmd/commands/property/parse.rs)2
-rw-r--r--whirl_server/src/cmd/commands/redirect_id.rs (renamed from src/server/cmd/commands/redirect_id.rs)2
-rw-r--r--whirl_server/src/cmd/commands/room_id_request.rs (renamed from src/server/cmd/commands/room_id_request.rs)2
-rw-r--r--whirl_server/src/cmd/commands/subscribe_distance.rs (renamed from src/server/cmd/commands/subscribe_distance.rs)2
-rw-r--r--whirl_server/src/cmd/commands/subscribe_room.rs (renamed from src/server/cmd/commands/subscribe_room.rs)2
-rw-r--r--whirl_server/src/cmd/commands/teleport.rs (renamed from src/server/cmd/commands/teleport.rs)2
-rw-r--r--whirl_server/src/cmd/commands/text.rs (renamed from src/server/cmd/commands/text.rs)2
-rw-r--r--whirl_server/src/cmd/constants.rs (renamed from src/server/cmd/constants.rs)0
-rw-r--r--whirl_server/src/cmd/extendable.rs (renamed from src/server/cmd/extendable.rs)0
-rw-r--r--whirl_server/src/cmd/mod.rs (renamed from src/server/cmd/mod.rs)0
-rw-r--r--whirl_server/src/cmd/set_parser.rs (renamed from src/server/cmd/set_parser.rs)2
-rw-r--r--whirl_server/src/cmd/structure.rs (renamed from src/server/cmd/structure.rs)0
-rw-r--r--whirl_server/src/distributor.rs (renamed from src/server/distributor.rs)2
-rw-r--r--whirl_server/src/hub.rs (renamed from src/server/hub.rs)2
-rw-r--r--whirl_server/src/interaction/mod.rs (renamed from src/server/interaction/mod.rs)0
-rw-r--r--whirl_server/src/interaction/peer.rs (renamed from src/server/interaction/peer.rs)2
-rw-r--r--whirl_server/src/interaction/shared.rs (renamed from src/server/interaction/shared.rs)2
-rw-r--r--whirl_server/src/lib.rs (renamed from src/server/mod.rs)7
-rw-r--r--whirl_server/src/net/constants.rs (renamed from src/server/net/constants.rs)0
-rw-r--r--whirl_server/src/net/converter.rs (renamed from src/server/net/converter.rs)2
-rw-r--r--whirl_server/src/net/mod.rs (renamed from src/server/net/mod.rs)0
-rw-r--r--whirl_server/src/net/property_parser.rs (renamed from src/server/net/property_parser.rs)2
-rw-r--r--whirl_server/src/net/structure.rs (renamed from src/server/net/structure.rs)0
-rw-r--r--whirl_server/src/packet_parser.rs (renamed from src/server/packet_parser.rs)0
-rw-r--r--whirl_server/src/types.rs (renamed from src/server/types.rs)0
53 files changed, 164 insertions, 93 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index a9052f0..e06a6a4 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -4,3 +4,6 @@ This document isn't very well detailed at the moment...
## Guidelines
1. Make sure your PR compiles. If the GitHub action "Rust ✅/ 🚫" fails, your PR will be declined.
2. Make sure your commit changes something other than just formatting.
+3. If you change updates any of the `Cargo.toml` files, make sure to
+ [install](https://github.com/est31/cargo-udeps#installation) and run `cargo +nightly udeps` to
+ make sure there aren't any unused dependencies.
diff --git a/Cargo.toml b/Cargo.toml
index 69597db..574e8e9 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,64 +1,5 @@
-[package]
-name = "whirl"
-version = "0.1.0"
-authors = ["Fuwn <[email protected]>"]
-edition = "2018"
-description = "Whirl, an open-source WorldServer implementation in Rust."
-documentation = "https://whirlsplash.org/docs/"
-readme = "README.md"
-homepage = "https://whirlsplash.org"
-repository = "https://github.com/Whirlsplash/whirl"
-license = "GPL-3.0-only"
-# license-file = "LICENSE"
-keywords = ["rust", "worldserver", "whirl", "whirlsplash"]
-publish = false
-
-# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
-
[workspace]
-members = ["whirl_config"]
-
-[dependencies]
-# Environment
-dotenv = "0.15.0"
-
-# Logging
-log = "0.4.14"
-flexi_logger = "0.17.1"
-
-# Utility
-rand = "0.8.3"
-async-trait = "0.1.50"
-sysinfo = "0.17.4"
-colour = "0.6.0"
-simple-error = "0.2.3"
-
-# Byte Manipulation
-bytes = "1.0.1"
-byteorder = "1.4.3"
-
-# Serialization
-serde = "1.0.126"
-serde_derive = "1.0.126"
-
-# CLI
-structopt = "0.3.21"
-
-# Config
-whirl_config = { path = "./whirl_config" }
-
-# TCP
-tokio = { version = "1.6.0", features = ["full"] }
-tokio-util = { version = "0.6.7", features = ["codec"] }
-tokio-stream = "0.1.6"
-
-# Database
-libsqlite3-sys = { version = "0.9.1", features = ["bundled"] }
-diesel = { version = "1.4.6", features = ["sqlite"] }
-
-# Web-server
-actix-web = { version = "3.3.2", features = ["rustls"] }
-actix-cors = "0.5.4"
+members = ["whirl_config", "whirl_core", "whirl_prompt", "whirl_server"]
-# Web
-curl = "0.4.37"
+[profile.release]
+lto = true
diff --git a/whirl_core/Cargo.toml b/whirl_core/Cargo.toml
new file mode 100644
index 0000000..8582d78
--- /dev/null
+++ b/whirl_core/Cargo.toml
@@ -0,0 +1,64 @@
+[package]
+name = "whirl_core"
+version = "0.1.0"
+authors = ["Fuwn <[email protected]>"]
+edition = "2018"
+description = "Whirl, an open-source WorldServer implementation in Rust."
+documentation = "https://whirlsplash.org/docs/"
+readme = "../README.md"
+homepage = "https://whirlsplash.org"
+repository = "https://github.com/Whirlsplash/whirl"
+license = "GPL-3.0-only"
+# license-file = "LICENSE"
+keywords = ["rust", "worldserver", "whirl", "whirlsplash"]
+publish = false
+
+# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
+
+[dependencies]
+# Environment
+dotenv = "0.15.0"
+
+# Logging
+log = "0.4.14"
+flexi_logger = "0.17.1"
+
+# Utility
+rand = "0.8.3"
+async-trait = "0.1.50"
+sysinfo = "0.17.4"
+simple-error = "0.2.3"
+
+# Byte Manipulation
+bytes = "1.0.1"
+byteorder = "1.4.3"
+
+# Serialization
+serde = "1.0.126"
+serde_derive = "1.0.126"
+
+# CLI
+structopt = "0.3.21"
+
+# Config
+whirl_config = { path = "../whirl_config" }
+
+# TCP
+tokio = { version = "1.6.0", features = ["full"] }
+tokio-util = { version = "0.6.7", features = ["codec"] }
+tokio-stream = "0.1.6"
+
+# Database
+libsqlite3-sys = { version = "0.9.1", features = ["bundled"] }
+diesel = { version = "1.4.6", features = ["sqlite"] }
+
+# Web-server
+actix-web = { version = "3.3.2", features = ["rustls"] }
+actix-cors = "0.5.4"
+
+# Prompt
+whirl_prompt = { path = "../whirl_prompt" }
+
+# Server
+whirl_server = { path = "../whirl_server" }
+
diff --git a/src/api/mod.rs b/whirl_core/src/api/mod.rs
index c744f3d..c744f3d 100644
--- a/src/api/mod.rs
+++ b/whirl_core/src/api/mod.rs
diff --git a/src/api/routes/mod.rs b/whirl_core/src/api/routes/mod.rs
index f5a2ff4..f5a2ff4 100644
--- a/src/api/routes/mod.rs
+++ b/whirl_core/src/api/routes/mod.rs
diff --git a/src/api/routes/stats/mod.rs b/whirl_core/src/api/routes/stats/mod.rs
index 04ce5e6..04ce5e6 100644
--- a/src/api/routes/stats/mod.rs
+++ b/whirl_core/src/api/routes/stats/mod.rs
diff --git a/src/api/routes/stats/structures.rs b/whirl_core/src/api/routes/stats/structures.rs
index 88fc852..88fc852 100644
--- a/src/api/routes/stats/structures.rs
+++ b/whirl_core/src/api/routes/stats/structures.rs
diff --git a/src/cli.rs b/whirl_core/src/cli.rs
index 6565845..6565845 100644
--- a/src/cli.rs
+++ b/whirl_core/src/cli.rs
diff --git a/src/db/mod.rs b/whirl_core/src/db/mod.rs
index b93390d..b93390d 100644
--- a/src/db/mod.rs
+++ b/whirl_core/src/db/mod.rs
diff --git a/src/db/models.rs b/whirl_core/src/db/models.rs
index 52304b6..52304b6 100644
--- a/src/db/models.rs
+++ b/whirl_core/src/db/models.rs
diff --git a/src/db/schema.rs b/whirl_core/src/db/schema.rs
index e2c0da4..e2c0da4 100644
--- a/src/db/schema.rs
+++ b/whirl_core/src/db/schema.rs
diff --git a/src/lib.rs b/whirl_core/src/lib.rs
index 527647b..5392a23 100644
--- a/src/lib.rs
+++ b/whirl_core/src/lib.rs
@@ -18,15 +18,11 @@ extern crate diesel;
#[macro_use]
extern crate serde_derive;
#[macro_use]
-extern crate async_trait;
-#[macro_use]
extern crate simple_error;
pub mod cli;
-pub mod prompt;
pub mod subs;
pub mod api;
pub mod db;
-pub mod server;
pub mod utils;
diff --git a/src/main.rs b/whirl_core/src/main.rs
index e48fbbb..32866b5 100644
--- a/src/main.rs
+++ b/whirl_core/src/main.rs
@@ -3,7 +3,7 @@
use std::error::Error;
-use whirl::{cli::Cli, utils::log::calculate_log_level};
+use whirl_core::{cli::Cli, utils::log::calculate_log_level};
use whirl_config::Config;
#[tokio::main]
diff --git a/src/subs.rs b/whirl_core/src/subs.rs
index dbf9b21..e9cf0e2 100644
--- a/src/subs.rs
+++ b/whirl_core/src/subs.rs
@@ -2,16 +2,16 @@
// SPDX-License-Identifier: GPL-3.0-only
use whirl_config::Config;
+use whirl_prompt::Prompt;
+use whirl_server::{
+ distributor::Distributor,
+ hub::Hub,
+ Server,
+ ServerType::{AutoServer, RoomServer},
+};
use crate::{
api::Api,
- prompt::Prompt,
- server::{
- distributor::Distributor,
- hub::Hub,
- Server,
- ServerType::{AutoServer, RoomServer},
- },
};
pub async fn run() {
diff --git a/src/utils/log.rs b/whirl_core/src/utils/log.rs
index 39ceca0..39ceca0 100644
--- a/src/utils/log.rs
+++ b/whirl_core/src/utils/log.rs
diff --git a/src/utils/mod.rs b/whirl_core/src/utils/mod.rs
index dc9a008..dc9a008 100644
--- a/src/utils/mod.rs
+++ b/whirl_core/src/utils/mod.rs
diff --git a/src/utils/sort.rs b/whirl_core/src/utils/sort.rs
index 131fa55..131fa55 100644
--- a/src/utils/sort.rs
+++ b/whirl_core/src/utils/sort.rs
diff --git a/src/utils/system.rs b/whirl_core/src/utils/system.rs
index 7a823a0..7a823a0 100644
--- a/src/utils/system.rs
+++ b/whirl_core/src/utils/system.rs
diff --git a/whirl_prompt/Cargo.toml b/whirl_prompt/Cargo.toml
new file mode 100644
index 0000000..83e09cd
--- /dev/null
+++ b/whirl_prompt/Cargo.toml
@@ -0,0 +1,25 @@
+[package]
+name = "whirl_prompt"
+version = "0.1.0"
+authors = ["Fuwn <[email protected]>"]
+edition = "2018"
+description = "Whirl, an open-source WorldServer implementation in Rust."
+documentation = "https://whirlsplash.org/docs/"
+readme = "../README.md"
+homepage = "https://whirlsplash.org"
+repository = "https://github.com/Whirlsplash/whirl"
+license = "GPL-3.0-only"
+# license-file = "LICENSE"
+keywords = ["rust", "worldserver", "whirl", "whirlsplash"]
+publish = false
+
+[dependencies]
+# Utility
+sysinfo = "0.17.4"
+colour = "0.6.0"
+
+# Config
+whirl_config = { path = "../whirl_config" }
+
+# Web
+curl = "0.4.37"
diff --git a/src/prompt/builtins.rs b/whirl_prompt/src/builtins.rs
index 442aeb5..442aeb5 100644
--- a/src/prompt/builtins.rs
+++ b/whirl_prompt/src/builtins.rs
diff --git a/src/prompt/mod.rs b/whirl_prompt/src/lib.rs
index d142cb1..85a725b 100644
--- a/src/prompt/mod.rs
+++ b/whirl_prompt/src/lib.rs
@@ -8,7 +8,7 @@ use std::{io, io::Write, str::FromStr};
use whirl_config::Config;
-use crate::prompt::{
+use crate::{
builtins::{
builtin_cat,
builtin_config,
@@ -37,7 +37,7 @@ impl Prompt {
Prompt::tokenize_command(prompt.read_command()),
prompt.history.clone(),
)
- .await;
+ .await;
}
}
diff --git a/src/prompt/structure.rs b/whirl_prompt/src/structure.rs
index b153cde..b153cde 100644
--- a/src/prompt/structure.rs
+++ b/whirl_prompt/src/structure.rs
diff --git a/whirl_server/Cargo.toml b/whirl_server/Cargo.toml
new file mode 100644
index 0000000..b093d17
--- /dev/null
+++ b/whirl_server/Cargo.toml
@@ -0,0 +1,37 @@
+[package]
+name = "whirl_server"
+version = "0.1.0"
+authors = ["Fuwn <[email protected]>"]
+edition = "2018"
+description = "Whirl, an open-source WorldServer implementation in Rust."
+documentation = "https://whirlsplash.org/docs/"
+readme = "../README.md"
+homepage = "https://whirlsplash.org"
+repository = "https://github.com/Whirlsplash/whirl"
+license = "GPL-3.0-only"
+# license-file = "LICENSE"
+keywords = ["rust", "worldserver", "whirl", "whirlsplash"]
+publish = false
+
+[dependencies]
+# Logging
+log = "0.4.14"
+
+# Utility
+async-trait = "0.1.50"
+
+# Byte Manipulation
+bytes = "1.0.1"
+byteorder = "1.4.3"
+
+# Serialization
+serde = "1.0.126"
+serde_derive = "1.0.126"
+
+# TCP
+tokio = { version = "1.6.0", features = ["full"] }
+tokio-util = { version = "0.6.7", features = ["codec"] }
+tokio-stream = "0.1.6"
+
+# Config
+whirl_config = { path = "../whirl_config" }
diff --git a/src/server/cmd/commands/action.rs b/whirl_server/src/cmd/commands/action.rs
index 8d1fb0b..8d1fb0b 100644
--- a/src/server/cmd/commands/action.rs
+++ b/whirl_server/src/cmd/commands/action.rs
diff --git a/src/server/cmd/commands/buddy_list.rs b/whirl_server/src/cmd/commands/buddy_list.rs
index 7e9722a..931db52 100644
--- a/src/server/cmd/commands/buddy_list.rs
+++ b/whirl_server/src/cmd/commands/buddy_list.rs
@@ -5,7 +5,7 @@ use std::str::from_utf8;
use bytes::{BufMut, BytesMut};
-use crate::server::cmd::{
+use crate::cmd::{
constants::BUDDYLISTNOTIFY,
extendable::{Creatable, Parsable},
};
diff --git a/src/server/cmd/commands/mod.rs b/whirl_server/src/cmd/commands/mod.rs
index 49758c2..49758c2 100644
--- a/src/server/cmd/commands/mod.rs
+++ b/whirl_server/src/cmd/commands/mod.rs
diff --git a/src/server/cmd/commands/property/create.rs b/whirl_server/src/cmd/commands/property/create.rs
index 88a9293..40ec2be 100644
--- a/src/server/cmd/commands/property/create.rs
+++ b/whirl_server/src/cmd/commands/property/create.rs
@@ -5,7 +5,7 @@
use whirl_config::Config;
-use crate::server::{
+use crate::{
cmd::constants::{PROPUPD, SESSINIT},
net::{
constants::{
diff --git a/src/server/cmd/commands/property/mod.rs b/whirl_server/src/cmd/commands/property/mod.rs
index 83b015b..83b015b 100644
--- a/src/server/cmd/commands/property/mod.rs
+++ b/whirl_server/src/cmd/commands/property/mod.rs
diff --git a/src/server/cmd/commands/property/parse.rs b/whirl_server/src/cmd/commands/property/parse.rs
index ef587fe..415d19f 100644
--- a/src/server/cmd/commands/property/parse.rs
+++ b/whirl_server/src/cmd/commands/property/parse.rs
@@ -1,7 +1,7 @@
// Copyleft (ɔ) 2021-2021 The Whirlsplash Collective
// SPDX-License-Identifier: GPL-3.0-only
-use crate::server::net::structure::NetworkProperty;
+use crate::net::structure::NetworkProperty;
pub fn find_property_in_property_list(
property_list: &[NetworkProperty],
diff --git a/src/server/cmd/commands/redirect_id.rs b/whirl_server/src/cmd/commands/redirect_id.rs
index edaf46e..8f56c86 100644
--- a/src/server/cmd/commands/redirect_id.rs
+++ b/whirl_server/src/cmd/commands/redirect_id.rs
@@ -4,7 +4,7 @@
use bytes::{BufMut, BytesMut};
use whirl_config::Config;
-use crate::server::cmd::{constants::REDIRID, extendable::Creatable};
+use crate::cmd::{constants::REDIRID, extendable::Creatable};
#[derive(Debug)]
pub struct RedirectId {
diff --git a/src/server/cmd/commands/room_id_request.rs b/whirl_server/src/cmd/commands/room_id_request.rs
index cc8dbeb..cf507fa 100644
--- a/src/server/cmd/commands/room_id_request.rs
+++ b/whirl_server/src/cmd/commands/room_id_request.rs
@@ -3,7 +3,7 @@
use std::str::from_utf8;
-use crate::server::cmd::extendable::Parsable;
+use crate::cmd::extendable::Parsable;
#[derive(Debug)]
pub struct RoomIdRequest {
diff --git a/src/server/cmd/commands/subscribe_distance.rs b/whirl_server/src/cmd/commands/subscribe_distance.rs
index 66f4241..d5cbcf6 100644
--- a/src/server/cmd/commands/subscribe_distance.rs
+++ b/whirl_server/src/cmd/commands/subscribe_distance.rs
@@ -4,7 +4,7 @@
use byteorder::{BigEndian, ReadBytesExt};
use bytes::{Buf, BytesMut};
-use crate::server::cmd::extendable::Parsable;
+use crate::cmd::extendable::Parsable;
#[derive(Debug)]
pub struct SubscribeDistance {
diff --git a/src/server/cmd/commands/subscribe_room.rs b/whirl_server/src/cmd/commands/subscribe_room.rs
index d936fff..9e7d732 100644
--- a/src/server/cmd/commands/subscribe_room.rs
+++ b/whirl_server/src/cmd/commands/subscribe_room.rs
@@ -4,7 +4,7 @@
use byteorder::{BigEndian, ReadBytesExt};
use bytes::{Buf, BytesMut};
-use crate::server::cmd::extendable::Parsable;
+use crate::cmd::extendable::Parsable;
#[derive(Debug)]
pub struct SubscribeRoom {
diff --git a/src/server/cmd/commands/teleport.rs b/whirl_server/src/cmd/commands/teleport.rs
index 7a2b55e..ef8f6b2 100644
--- a/src/server/cmd/commands/teleport.rs
+++ b/whirl_server/src/cmd/commands/teleport.rs
@@ -4,7 +4,7 @@
use byteorder::{BigEndian, ReadBytesExt};
use bytes::{Buf, BytesMut};
-use crate::server::cmd::extendable::Parsable;
+use crate::cmd::extendable::Parsable;
#[derive(Debug)]
pub struct Teleport {
diff --git a/src/server/cmd/commands/text.rs b/whirl_server/src/cmd/commands/text.rs
index 5019fc1..2bf7e17 100644
--- a/src/server/cmd/commands/text.rs
+++ b/whirl_server/src/cmd/commands/text.rs
@@ -5,7 +5,7 @@ use std::str::from_utf8;
use bytes::{BufMut, BytesMut};
-use crate::server::cmd::{
+use crate::cmd::{
constants::TEXT,
extendable::{Creatable, ParsableWithArguments},
};
diff --git a/src/server/cmd/constants.rs b/whirl_server/src/cmd/constants.rs
index 22d29c1..22d29c1 100644
--- a/src/server/cmd/constants.rs
+++ b/whirl_server/src/cmd/constants.rs
diff --git a/src/server/cmd/extendable.rs b/whirl_server/src/cmd/extendable.rs
index e6f3c2b..e6f3c2b 100644
--- a/src/server/cmd/extendable.rs
+++ b/whirl_server/src/cmd/extendable.rs
diff --git a/src/server/cmd/mod.rs b/whirl_server/src/cmd/mod.rs
index ef91de7..ef91de7 100644
--- a/src/server/cmd/mod.rs
+++ b/whirl_server/src/cmd/mod.rs
diff --git a/src/server/cmd/set_parser.rs b/whirl_server/src/cmd/set_parser.rs
index 6d11f04..9d6a4b3 100644
--- a/src/server/cmd/set_parser.rs
+++ b/whirl_server/src/cmd/set_parser.rs
@@ -1,7 +1,7 @@
// Copyleft (ɔ) 2021-2021 The Whirlsplash Collective
// SPDX-License-Identifier: GPL-3.0-only
-use crate::server::cmd::structure::Command;
+use crate::cmd::structure::Command;
/// Iterate over a command set in the from of bytes and return a list of
/// human-readable commands.
diff --git a/src/server/cmd/structure.rs b/whirl_server/src/cmd/structure.rs
index 23e91ca..23e91ca 100644
--- a/src/server/cmd/structure.rs
+++ b/whirl_server/src/cmd/structure.rs
diff --git a/src/server/distributor.rs b/whirl_server/src/distributor.rs
index 4267a78..ae920cb 100644
--- a/src/server/distributor.rs
+++ b/whirl_server/src/distributor.rs
@@ -18,7 +18,7 @@ use tokio_stream::StreamExt;
use tokio_util::codec::{BytesCodec, Decoder};
use whirl_config::Config;
-use crate::server::{
+use crate::{
cmd::{
commands::{
action::create_action,
diff --git a/src/server/hub.rs b/whirl_server/src/hub.rs
index 99ba600..09f2dac 100644
--- a/src/server/hub.rs
+++ b/whirl_server/src/hub.rs
@@ -14,7 +14,7 @@ use tokio_stream::StreamExt;
use tokio_util::codec::{BytesCodec, Decoder};
use whirl_config::Config;
-use crate::server::{
+use crate::{
cmd::{
commands::{
action::create_action,
diff --git a/src/server/interaction/mod.rs b/whirl_server/src/interaction/mod.rs
index c85e09d..c85e09d 100644
--- a/src/server/interaction/mod.rs
+++ b/whirl_server/src/interaction/mod.rs
diff --git a/src/server/interaction/peer.rs b/whirl_server/src/interaction/peer.rs
index 1d5ed9f..38c02c5 100644
--- a/src/server/interaction/peer.rs
+++ b/whirl_server/src/interaction/peer.rs
@@ -9,7 +9,7 @@ use tokio::{
};
use tokio_util::codec::{BytesCodec, Framed};
-use crate::server::{interaction::shared::Shared, types::Rx};
+use crate::{interaction::shared::Shared, types::Rx};
pub struct Peer {
pub bytes: Framed<TcpStream, BytesCodec>,
diff --git a/src/server/interaction/shared.rs b/whirl_server/src/interaction/shared.rs
index c9eebbc..c2ee671 100644
--- a/src/server/interaction/shared.rs
+++ b/whirl_server/src/interaction/shared.rs
@@ -5,7 +5,7 @@ use std::collections::HashMap;
use bytes::BytesMut;
-use crate::server::types::Tx;
+use crate::types::Tx;
pub struct Shared {
pub peers: HashMap<String, Tx>,
diff --git a/src/server/mod.rs b/whirl_server/src/lib.rs
index 8aad465..196dd6b 100644
--- a/src/server/mod.rs
+++ b/whirl_server/src/lib.rs
@@ -1,6 +1,11 @@
// Copyleft (ɔ) 2021-2021 The Whirlsplash Collective
// SPDX-License-Identifier: GPL-3.0-only
+#[macro_use]
+extern crate log;
+#[macro_use]
+extern crate async_trait;
+
pub mod cmd;
mod interaction;
pub mod net;
@@ -17,7 +22,7 @@ use tokio::{
sync::Mutex,
};
-use crate::server::interaction::shared::Shared;
+use crate::interaction::shared::Shared;
#[derive(Debug)]
pub enum ServerType {
diff --git a/src/server/net/constants.rs b/whirl_server/src/net/constants.rs
index 169b461..169b461 100644
--- a/src/server/net/constants.rs
+++ b/whirl_server/src/net/constants.rs
diff --git a/src/server/net/converter.rs b/whirl_server/src/net/converter.rs
index aa4e8ed..0f2fc07 100644
--- a/src/server/net/converter.rs
+++ b/whirl_server/src/net/converter.rs
@@ -3,7 +3,7 @@
use bytes::{BufMut, BytesMut};
-use crate::server::{
+use crate::{
cmd::constants::PROPUPD,
net::{
constants::{PROPACCESS_POSSESS, PROPFLAG_DBSTORE},
diff --git a/src/server/net/mod.rs b/whirl_server/src/net/mod.rs
index afa45c8..afa45c8 100644
--- a/src/server/net/mod.rs
+++ b/whirl_server/src/net/mod.rs
diff --git a/src/server/net/property_parser.rs b/whirl_server/src/net/property_parser.rs
index d6d4ebe..5d8a494 100644
--- a/src/server/net/property_parser.rs
+++ b/whirl_server/src/net/property_parser.rs
@@ -3,7 +3,7 @@
use std::str::from_utf8;
-use crate::server::net::structure::NetworkProperty;
+use crate::net::structure::NetworkProperty;
/// Iterate over a network property in the form of bytes and return a list of
/// human-readable properties.
diff --git a/src/server/net/structure.rs b/whirl_server/src/net/structure.rs
index 1fb1051..1fb1051 100644
--- a/src/server/net/structure.rs
+++ b/whirl_server/src/net/structure.rs
diff --git a/src/server/packet_parser.rs b/whirl_server/src/packet_parser.rs
index c50569d..c50569d 100644
--- a/src/server/packet_parser.rs
+++ b/whirl_server/src/packet_parser.rs
diff --git a/src/server/types.rs b/whirl_server/src/types.rs
index 3d49752..3d49752 100644
--- a/src/server/types.rs
+++ b/whirl_server/src/types.rs