aboutsummaryrefslogtreecommitdiff
path: root/crates/whirl_server/src
diff options
context:
space:
mode:
authorFuwn <[email protected]>2024-06-12 01:41:01 +0000
committerFuwn <[email protected]>2024-06-12 01:41:01 +0000
commit7c74675874649eea651b6623600379897a437655 (patch)
tree6934aca700c03715e9a268dee2f7e44f7426d51c /crates/whirl_server/src
parentfeat(commands): add channel command (diff)
downloadwhirl-7c74675874649eea651b6623600379897a437655.tar.xz
whirl-7c74675874649eea651b6623600379897a437655.zip
refactor(command): clearer field names
Diffstat (limited to 'crates/whirl_server/src')
-rw-r--r--crates/whirl_server/src/cmd/structure.rs17
1 files changed, 9 insertions, 8 deletions
diff --git a/crates/whirl_server/src/cmd/structure.rs b/crates/whirl_server/src/cmd/structure.rs
index de6567e..798f1f1 100644
--- a/crates/whirl_server/src/cmd/structure.rs
+++ b/crates/whirl_server/src/cmd/structure.rs
@@ -3,10 +3,11 @@
#[derive(Default)]
pub struct Command {
- pub length: i32,
- pub obj_id: i32,
- pub id: i32,
- pub body: Vec<u8>,
+ pub length: i32,
+ pub short_object_id: i32,
+ #[allow(clippy::struct_field_names)]
+ pub command_type: i32,
+ pub body: Vec<u8>,
}
impl Command {
/// Create and return a new `Command` with default values (`0`s and empty).
@@ -27,10 +28,10 @@ impl Command {
let command_length = data[0];
let mut command = Self {
- length: i32::from(command_length),
- obj_id: i32::from(data[1]),
- id: i32::from(data[2]),
- body: vec![],
+ length: i32::from(command_length),
+ short_object_id: i32::from(data[1]),
+ command_type: i32::from(data[2]),
+ body: vec![],
};
if command.length > 3 {
data[3..].clone_into(&mut command.body);