Skip to content
This repository was archived by the owner on Mar 11, 2025. It is now read-only.

Commit 4f5e706

Browse files
committed
backport #443 to v2
1 parent 6f887ba commit 4f5e706

File tree

2 files changed

+101
-297
lines changed

2 files changed

+101
-297
lines changed

token/program/src/pack.rs

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -47,33 +47,6 @@ pub trait Pack: Sealed {
4747
Ok(Self::unpack_from_slice(input)?)
4848
}
4949

50-
/// Borrow `Self` from `input` for the duration of the call to `f`, but first check that `Self`
51-
/// is initialized
52-
#[inline(never)]
53-
fn unpack_mut<F, U>(input: &mut [u8], f: &mut F) -> Result<U, ProgramError>
54-
where
55-
F: FnMut(&mut Self) -> Result<U, ProgramError>,
56-
Self: IsInitialized,
57-
{
58-
let mut t = Self::unpack(input)?;
59-
let u = f(&mut t)?;
60-
Self::pack(t, input)?;
61-
Ok(u)
62-
}
63-
64-
/// Borrow `Self` from `input` for the duration of the call to `f`, without checking that
65-
/// `Self` has been initialized
66-
#[inline(never)]
67-
fn unpack_unchecked_mut<F, U>(input: &mut [u8], f: &mut F) -> Result<U, ProgramError>
68-
where
69-
F: FnMut(&mut Self) -> Result<U, ProgramError>,
70-
{
71-
let mut t = Self::unpack_unchecked(input)?;
72-
let u = f(&mut t)?;
73-
Self::pack(t, input)?;
74-
Ok(u)
75-
}
76-
7750
/// Pack into slice
7851
fn pack(src: Self, dst: &mut [u8]) -> Result<(), ProgramError> {
7952
if dst.len() != Self::LEN {

0 commit comments

Comments
 (0)