Armani Ferrante 3 年之前
父节点
当前提交
cb8584c015
共有 3 个文件被更改,包括 2 次插入4 次删除
  1. 0 1
      lang/src/accounts/account.rs
  2. 0 1
      lang/src/accounts/program_account.rs
  3. 2 2
      lang/src/lib.rs

+ 0 - 1
lang/src/accounts/account.rs

@@ -1,6 +1,5 @@
 //! Account container that checks ownership on deserialization.
 
-use crate::accounts::header;
 use crate::error::ErrorCode;
 use crate::*;
 use solana_program::account_info::AccountInfo;

+ 0 - 1
lang/src/accounts/program_account.rs

@@ -1,6 +1,5 @@
 #[allow(deprecated)]
 use crate::accounts::cpi_account::CpiAccount;
-use crate::accounts::header;
 use crate::error::ErrorCode;
 use crate::*;
 use solana_program::account_info::AccountInfo;

+ 2 - 2
lang/src/lib.rs

@@ -30,7 +30,6 @@ use solana_program::instruction::AccountMeta;
 use solana_program::program_error::ProgramError;
 use solana_program::pubkey::Pubkey;
 use std::collections::BTreeMap;
-use std::io::Write;
 
 mod account_meta;
 pub mod accounts;
@@ -146,7 +145,8 @@ where
 /// In most cases, one can use the default implementation provided by the
 /// [`#[account]`](./attr.account.html) attribute.
 pub trait AccountSerialize {
-    /// Serializes the account data into `writer`.
+    /// Serializes the account into the data buffer. Does not modify the
+    /// account header.
     fn try_serialize(&self, _data: &mut [u8]) -> Result<(), ProgramError> {
         Ok(())
     }