Skip to content

Commit

Permalink
Simplify BorshSerialize trait boundsy
Browse files Browse the repository at this point in the history
  • Loading branch information
danlehmann committed Jul 23, 2024
1 parent b7ca182 commit adb6f6f
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1070,14 +1070,7 @@ where
impl<T, const BITS: usize> borsh::BorshSerialize for UInt<T, BITS>
where
Self: Number,
T: borsh::BorshSerialize
+ From<u8>
+ BitAnd<T, Output = T>
+ TryInto<u8>
+ Copy
+ Shr<usize, Output = T>,
<UInt<T, BITS> as Number>::UnderlyingType:
Shr<usize, Output = T> + TryInto<u8> + From<u8> + BitAnd<T>,
T: borsh::BorshSerialize,
{
fn serialize<W: borsh::io::Write>(&self, writer: &mut W) -> borsh::io::Result<()> {
let serialized_byte_count = (BITS + 7) / 8;
Expand Down

0 comments on commit adb6f6f

Please sign in to comment.