From b2320d9510d6f7385d019d349c21869b2a88889f Mon Sep 17 00:00:00 2001 From: guibescos <59208140+guibescos@users.noreply.github.com> Date: Wed, 24 Jul 2024 22:46:07 +0100 Subject: [PATCH] Update program/rust/src/accounts/price.rs Co-authored-by: Pavel Strakhov --- program/rust/src/accounts/price.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/program/rust/src/accounts/price.rs b/program/rust/src/accounts/price.rs index 2587afc3..7ee41675 100644 --- a/program/rust/src/accounts/price.rs +++ b/program/rust/src/accounts/price.rs @@ -345,9 +345,7 @@ impl PythOracleSerialize for TwapMessage { impl PythOracleSerialize for PublisherStakeCapsMessage { fn to_bytes(self) -> Vec { const DISCRIMINATOR: u8 = 2; - let mut result: Vec = Vec::new(); - - result.extend_from_slice(&[DISCRIMINATOR]); + let mut result = vec![DISCRIMINATOR]; result.extend_from_slice(&self.publish_time.to_be_bytes()); result.extend_from_slice( &TryInto::::try_into(self.caps.as_ref().len())