Skip to content

Commit

Permalink
Use macro.
Browse files Browse the repository at this point in the history
  • Loading branch information
finnbear committed Sep 20, 2024
1 parent a1a5cc0 commit 424032f
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions src/ext/rust_decimal.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
use crate::{
convert::{self, ConvertFrom},
convert::{self, impl_convert, ConvertFrom},
Decode, Encode,
};
use bytemuck::CheckedBitPattern;
use rust_decimal::Decimal;

type DecimalConversion = (u32, u32, u32, Flags);

impl ConvertFrom<&Decimal> for DecimalConversion {
Expand All @@ -31,13 +30,7 @@ impl ConvertFrom<DecimalConversion> for Decimal {
}
}

impl Encode for Decimal {
type Encoder = convert::ConvertIntoEncoder<DecimalConversion>;
}

impl<'a> Decode<'a> for Decimal {
type Decoder = convert::ConvertFromDecoder<'a, DecimalConversion>;
}
impl_convert!(Decimal, DecimalConversion);

impl ConvertFrom<&Flags> for u8 {
fn convert_from(flags: &Flags) -> Self {
Expand Down

0 comments on commit 424032f

Please sign in to comment.