Skip to content

Commit

Permalink
Relaxing further bounds
Browse files Browse the repository at this point in the history
  • Loading branch information
ryan-summers committed Jul 16, 2024
1 parent f0381fb commit e76157e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/publication.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,17 @@ impl<const N: usize> ToPayload for &[u8; N] {
/// # Note
/// This is "deferred" because the closure will only be called once the publication is actually
/// sent.
pub struct DeferredPublication<E, F: FnOnce(&mut [u8]) -> Result<usize, E>> {
pub struct DeferredPublication<F> {
func: F,
}

impl<E, F: FnOnce(&mut [u8]) -> Result<usize, E>> DeferredPublication<E, F> {
impl<E, F: FnOnce(&mut [u8]) -> Result<usize, E>> DeferredPublication<F> {
pub fn new<'a>(func: F) -> Publication<'a, Self> {
Publication::new(Self { func })
}
}

impl<E, F: FnOnce(&mut [u8]) -> Result<usize, E>> ToPayload for DeferredPublication<E, F> {
impl<E, F: FnOnce(&mut [u8]) -> Result<usize, E>> ToPayload for DeferredPublication<F> {
type Error = E;
fn serialize(self, buffer: &mut [u8]) -> Result<usize, E> {
(self.func)(buffer)
Expand Down
2 changes: 1 addition & 1 deletion src/varint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ impl VarintWriter for VarintBuffer {

struct VarintVisitor;

struct VarintParser<'de, T: serde::de::SeqAccess<'de>> {
struct VarintParser<'de, T> {
seq: T,
_data: core::marker::PhantomData<&'de ()>,
}
Expand Down

0 comments on commit e76157e

Please sign in to comment.