aboutsummaryrefslogtreecommitdiff
path: root/crates/whirl_server/src/cmd/structure.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/whirl_server/src/cmd/structure.rs')
-rw-r--r--crates/whirl_server/src/cmd/structure.rs6
1 files changed, 2 insertions, 4 deletions
diff --git a/crates/whirl_server/src/cmd/structure.rs b/crates/whirl_server/src/cmd/structure.rs
index 54d47ed..de6567e 100644
--- a/crates/whirl_server/src/cmd/structure.rs
+++ b/crates/whirl_server/src/cmd/structure.rs
@@ -1,6 +1,7 @@
// Copyright (C) 2021-2021 The Whirlsplash Collective
// SPDX-License-Identifier: GPL-3.0-only
+#[derive(Default)]
pub struct Command {
pub length: i32,
pub obj_id: i32,
@@ -32,7 +33,7 @@ impl Command {
body: vec![],
};
if command.length > 3 {
- command.body = data[3..].to_owned();
+ data[3..].clone_into(&mut command.body);
}
command_set.push(command);
@@ -44,6 +45,3 @@ impl Command {
command_set
}
}
-impl Default for Command {
- fn default() -> Self { Self { length: 0, obj_id: 0, id: 0, body: vec![] } }
-}