Skip to content

Commit

Permalink
Merge pull request #605 from libpnet/revert-599-blanket_impls
Browse files Browse the repository at this point in the history
Revert "Add blanket impls of Packet for Box<T> and &T."
  • Loading branch information
mrmonday committed Feb 3, 2023
2 parents 9a3a0ba + 60cab23 commit 4e9993c
Showing 1 changed file with 0 additions and 25 deletions.
25 changes: 0 additions & 25 deletions pnet_macros_support/src/packet.rs
Expand Up @@ -23,31 +23,6 @@ pub trait Packet {
fn payload(&self) -> &[u8];
}

/// Blanket impl for Boxed objects
impl<T: Packet> Packet for alloc::boxed::Box<T> {
/// Retrieve the underlying buffer for the packet.
fn packet(&self) -> &[u8] {
self.packet()
}

/// Retrieve the payload for the packet.
fn payload(&self) -> &[u8] {
self.payload()
}
}

impl<T: Packet> Packet for &T {
/// Retrieve the underlying buffer for the packet.
fn packet(&self) -> &[u8] {
self.packet()
}

/// Retrieve the payload for the packet.
fn payload(&self) -> &[u8] {
self.payload()
}
}

/// Represents a generic, mutable, network packet.
pub trait MutablePacket: Packet {
/// Retreive the underlying, mutable, buffer for the packet.
Expand Down

0 comments on commit 4e9993c

Please sign in to comment.