From 3757b0dfad27af62e79d2910c2a2cd32fc7cf576 Mon Sep 17 00:00:00 2001 From: "Jean Marchand (Exotic Markets)" Date: Sun, 15 Sep 2024 15:43:10 +0200 Subject: [PATCH] Remove unnecessary cloning (#61) --- programs/thread/src/instructions/thread_exec.rs | 2 +- programs/thread/src/state/crate_info.rs | 17 ----------------- 2 files changed, 1 insertion(+), 18 deletions(-) delete mode 100644 programs/thread/src/state/crate_info.rs diff --git a/programs/thread/src/instructions/thread_exec.rs b/programs/thread/src/instructions/thread_exec.rs index 690442ef..ed23a362 100644 --- a/programs/thread/src/instructions/thread_exec.rs +++ b/programs/thread/src/instructions/thread_exec.rs @@ -199,7 +199,7 @@ pub fn handler(ctx: Context) -> Result<()> { } // If the worker is in the pool, debit from the thread account and payout to the worker's fee account. - if pool.clone().into_inner().workers.contains(&worker.key()) { + if pool.workers.contains(&worker.key()) { thread.sub_lamports(thread.fee)?; fee.add_lamports(thread.fee)?; } diff --git a/programs/thread/src/state/crate_info.rs b/programs/thread/src/state/crate_info.rs deleted file mode 100644 index a3820880..00000000 --- a/programs/thread/src/state/crate_info.rs +++ /dev/null @@ -1,17 +0,0 @@ -use anchor_lang::{prelude::*, AnchorDeserialize, AnchorSerialize}; -use std::fmt::{Display, Formatter}; - -/// The crate build information -#[derive(AnchorDeserialize, AnchorSerialize, Clone, Debug)] -pub struct CrateInfo { - /// The link to the crate spec - pub spec: String, - /// Arbitrary blob that can be set by developers - pub blob: String, -} - -impl Display for CrateInfo { - fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { - write!(f, "spec:{} blob:{}", self.spec, self.blob) - } -}