aboutsummaryrefslogtreecommitdiff
path: root/src/server/cmd/set_parser.rs
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 /src/server/cmd/set_parser.rs
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.
Diffstat (limited to 'src/server/cmd/set_parser.rs')
-rw-r--r--src/server/cmd/set_parser.rs39
1 files changed, 0 insertions, 39 deletions
diff --git a/src/server/cmd/set_parser.rs b/src/server/cmd/set_parser.rs
deleted file mode 100644
index 6d11f04..0000000
--- a/src/server/cmd/set_parser.rs
+++ /dev/null
@@ -1,39 +0,0 @@
-// Copyleft (ɔ) 2021-2021 The Whirlsplash Collective
-// SPDX-License-Identifier: GPL-3.0-only
-
-use crate::server::cmd::structure::Command;
-
-/// Iterate over a command set in the from of bytes and return a list of
-/// human-readable commands.
-fn _parse_command_set(mut data: Vec<u8>) -> Vec<Command> {
- let mut command_set = vec![];
-
- // Iterate over all commands
- loop {
- // Check if any commands are present
- if data.len() <= 2 {
- break;
- }
- if data[0] == 0 {
- break;
- }
-
- let command_length = data[0];
- let mut command = Command {
- length: command_length as i32,
- obj_id: data[1] as i32,
- id: data[2] as i32,
- body: vec![],
- };
- if command.length > 3 {
- command.body = data[3..].to_owned();
- }
- command_set.push(command);
-
- // Remove current command from the command set
- data = data[command_length as usize..].to_vec();
- }
-
- // Return the human-readable command set
- command_set
-}