From ad95589a8a01ec1ca1ff8826d457691f94da6770 Mon Sep 17 00:00:00 2001 From: zirkonya Date: Tue, 1 Sep 2026 10:10:23 +0200 Subject: rust cargo fmt --- src/codec/decode.rs | 2 +- src/codec/encode.rs | 12 ++++++++++-- src/context.rs | 2 +- src/transport/receiver.rs | 2 +- src/transport/sender.rs | 2 +- src/types/prefix/count.rs | 7 ++----- 6 files changed, 16 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/codec/decode.rs b/src/codec/decode.rs index d068760..47e8dad 100644 --- a/src/codec/decode.rs +++ b/src/codec/decode.rs @@ -4,7 +4,7 @@ use std::{ sync::Arc, }; -use crate::{codec::error::Result, codec::error::CodecError, context::Context}; +use crate::{codec::error::CodecError, codec::error::Result, context::Context}; macro_rules! impl_decode { ($t:ty) => { diff --git a/src/codec/encode.rs b/src/codec/encode.rs index 735aa70..7a65bb5 100644 --- a/src/codec/encode.rs +++ b/src/codec/encode.rs @@ -10,7 +10,11 @@ macro_rules! impl_encode { Ok(std::mem::size_of::<$t>()) } - fn encode_slice(slice: &[Self], buffer: &mut Vec, _: &Context) -> Result + fn encode_slice( + slice: &[Self], + buffer: &mut Vec, + _: &Context, + ) -> Result where Self: Sized, { @@ -22,7 +26,11 @@ macro_rules! impl_encode { Ok(len) } - fn encode_iter<'a, I>(iter: I, buffer: &mut Vec, ctx: &Context) -> Result + fn encode_iter<'a, I>( + iter: I, + buffer: &mut Vec, + ctx: &Context, + ) -> Result where Self: 'a + Sized, I: IntoIterator, diff --git a/src/context.rs b/src/context.rs index bcc0b6d..0c42c23 100644 --- a/src/context.rs +++ b/src/context.rs @@ -6,4 +6,4 @@ impl Context { pub fn new(data: Data) -> Self { Self { data } } -} \ No newline at end of file +} diff --git a/src/transport/receiver.rs b/src/transport/receiver.rs index a165110..6f00f87 100644 --- a/src/transport/receiver.rs +++ b/src/transport/receiver.rs @@ -15,4 +15,4 @@ impl> PacketReceiver> PacketSender for S { packet.encode(&mut buf, ctx)?; self.send_buf(&buf) } -} \ No newline at end of file +} diff --git a/src/types/prefix/count.rs b/src/types/prefix/count.rs index 04bc7c6..f8ac68d 100644 --- a/src/types/prefix/count.rs +++ b/src/types/prefix/count.rs @@ -90,10 +90,7 @@ where L: Codec + Size, D: IntoIterator + FromIterator, { - fn decode( - buf: &mut &[u8], - ctx: &Context, - ) -> crate::codec::error::Result + fn decode(buf: &mut &[u8], ctx: &Context) -> crate::codec::error::Result where Self: Sized, { @@ -108,4 +105,4 @@ where _len: PhantomData, }) } -} \ No newline at end of file +} -- cgit v1.2.3