Forráskód Böngészése

spl: Make `TokenAccount` and `Mint` `Copy` (#2904)

Bhargava Sai Macha 1 éve
szülő
commit
a18d6caa6d
3 módosított fájl, 5 hozzáadás és 4 törlés
  1. 1 0
      CHANGELOG.md
  2. 2 2
      spl/src/token.rs
  3. 2 2
      spl/src/token_interface.rs

+ 1 - 0
CHANGELOG.md

@@ -71,6 +71,7 @@ The minor version will be incremented upon a breaking change and the patch versi
 - avm, cli: Fix `stdsimd` feature compilation error from `ahash` when installing the CLI using newer Rust versions ([#2867](https://github.com/coral-xyz/anchor/pull/2867)).
 - spl: Fix not being able to deserialize newer token 2022 extensions ([#2876](https://github.com/coral-xyz/anchor/pull/2876)).
 - spl: Remove `solana-program` dependency ([#2900](https://github.com/coral-xyz/anchor/pull/2900)).
+- spl: Make TokenAccount and Mint Copy ([#2904])(https://github.com/coral-xyz/anchor/pull/2904)
 
 ### Breaking
 

+ 2 - 2
spl/src/token.rs

@@ -443,7 +443,7 @@ pub struct SyncNative<'info> {
     pub account: AccountInfo<'info>,
 }
 
-#[derive(Clone, Debug, Default, PartialEq)]
+#[derive(Clone, Debug, Default, PartialEq, Copy)]
 pub struct TokenAccount(spl_token::state::Account);
 
 impl TokenAccount {
@@ -474,7 +474,7 @@ impl Deref for TokenAccount {
     }
 }
 
-#[derive(Clone, Debug, Default, PartialEq)]
+#[derive(Clone, Debug, Default, PartialEq, Copy)]
 pub struct Mint(spl_token::state::Mint);
 
 impl Mint {

+ 2 - 2
spl/src/token_interface.rs

@@ -13,7 +13,7 @@ pub use crate::token_2022_extensions::*;
 
 static IDS: [Pubkey; 2] = [spl_token::ID, spl_token_2022::ID];
 
-#[derive(Clone, Debug, Default, PartialEq)]
+#[derive(Clone, Debug, Default, PartialEq, Copy)]
 pub struct TokenAccount(spl_token_2022::state::Account);
 
 impl anchor_lang::AccountDeserialize for TokenAccount {
@@ -42,7 +42,7 @@ impl Deref for TokenAccount {
     }
 }
 
-#[derive(Clone, Debug, Default, PartialEq)]
+#[derive(Clone, Debug, Default, PartialEq, Copy)]
 pub struct Mint(spl_token_2022::state::Mint);
 
 impl anchor_lang::AccountDeserialize for Mint {