Skip to content

Commit 0cb7f3a

Browse files
committed
fix: .try_to_vec -> to_vec()
1 parent bc06a25 commit 0cb7f3a

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

basics/cross-program-invocation/native/programs/lever/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ cpi = ["no-entrypoint"]
99

1010
[dependencies]
1111
borsh = "1.5.7"
12-
borsh-derive = "0.10"
1312
solana-program = "2.0"
1413

1514
[lib]

basics/cross-program-invocation/native/programs/lever/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use borsh::{BorshDeserialize, BorshSerialize};
1+
use borsh::{to_vec, BorshDeserialize, BorshSerialize};
22
#[cfg(not(feature = "no-entrypoint"))]
33
use solana_program::entrypoint;
44
use solana_program::{
@@ -42,7 +42,7 @@ pub fn initialize(
4242
let user = next_account_info(accounts_iter)?;
4343
let system_program = next_account_info(accounts_iter)?;
4444

45-
let account_span = (power_status.try_to_vec()?).len();
45+
let account_span = (to_vec(&power_status))?.len();
4646
let lamports_required = (Rent::get()?).minimum_balance(account_span);
4747

4848
invoke(

0 commit comments

Comments
 (0)