Skip to content

Commit

Permalink
forgot other circbuf arbitrary
Browse files Browse the repository at this point in the history
  • Loading branch information
2501babe committed Jul 18, 2024
1 parent 078c348 commit 10a4593
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions sdk/program/src/vote/state/vote_state_0_23_5.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ pub struct VoteState0_23_5 {
}

#[derive(Debug, Serialize, Deserialize, PartialEq, Eq, Clone)]
#[cfg_attr(test, derive(Arbitrary))]
pub struct CircBuf<I> {
pub buf: [I; MAX_ITEMS],
/// next pointer
Expand All @@ -63,23 +64,6 @@ impl<I> CircBuf<I> {
}
}

#[cfg(test)]
impl<'a, I: Default + Copy> Arbitrary<'a> for CircBuf<I>
where
I: Arbitrary<'a>,
{
fn arbitrary(u: &mut Unstructured<'a>) -> arbitrary::Result<Self> {
let mut circbuf = Self::default();

let len = u.arbitrary_len::<I>()?;
for _ in 0..len {
circbuf.append(I::arbitrary(u)?);
}

Ok(circbuf)
}
}

#[cfg(test)]
mod tests {
use super::*;
Expand Down

0 comments on commit 10a4593

Please sign in to comment.