From 95d4bd223c93f9027ae4161044df0576d4a9e4e9 Mon Sep 17 00:00:00 2001 From: Martin Moreira de Jesus Date: Wed, 17 Apr 2024 09:49:02 +0200 Subject: [PATCH] chore(serverless-protocol): fix warnings --- src/serverless_protocol/src/lib.rs | 4 ++-- src/serverless_protocol/src/messages.rs | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/serverless_protocol/src/lib.rs b/src/serverless_protocol/src/lib.rs index c416169..d7f8a33 100644 --- a/src/serverless_protocol/src/lib.rs +++ b/src/serverless_protocol/src/lib.rs @@ -94,8 +94,8 @@ impl CloudletProtocol { let message_type = message.message_type as u16; buffer.push((message.checksum >> 8) as u8); buffer.push((message.checksum & 0xFF) as u8); - buffer.push((message_type as u16 >> 8) as u8); - buffer.push((message_type as u16 & 0xFF) as u8); + buffer.push((message_type >> 8) as u8); + buffer.push((message_type & 0xFF) as u8); let json_payload = serde_json::to_string(&message.payload).unwrap(); buffer.extend(json_payload.as_bytes()); diff --git a/src/serverless_protocol/src/messages.rs b/src/serverless_protocol/src/messages.rs index 714bf04..c89af45 100644 --- a/src/serverless_protocol/src/messages.rs +++ b/src/serverless_protocol/src/messages.rs @@ -85,6 +85,12 @@ impl OkMessage { } } +impl Default for OkMessage { + fn default() -> Self { + Self::new() + } +} + /// Expects OkMessage #[derive(Debug, Clone, Serialize, Deserialize)] pub struct LogMessage {