aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFuwn <[email protected]>2024-06-12 01:41:01 -0700
committerFuwn <[email protected]>2024-06-12 01:41:01 -0700
commit9e4a34a54d40794528d3af19a2362fcb22f2a17b (patch)
tree8af269de26157665eca6bf13e99ce082cdb3c1e8
parentfeat(commands): add channel command (diff)
downloadwhirl-9e4a34a54d40794528d3af19a2362fcb22f2a17b.tar.xz
whirl-9e4a34a54d40794528d3af19a2362fcb22f2a17b.zip
refactor(command): clearer field names
-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);