Skip to content

Revert "Add blanket impls of Packet for Box<T> and &T."#605

Merged
mrmonday merged 1 commit intomasterfrom
revert-599-blanket_impls
Feb 3, 2023
Merged

Revert "Add blanket impls of Packet for Box<T> and &T."#605
mrmonday merged 1 commit intomasterfrom
revert-599-blanket_impls

Conversation

@mrmonday
Copy link
Copy Markdown
Contributor

@mrmonday mrmonday commented Feb 3, 2023

Reverts #599

Looks like the implementation was incorrect, it gives the following warnings:

warning: function cannot return without recursing
  --> pnet_macros_support/src/packet.rs:29:5
   |
29 |     fn packet(&self) -> &[u8] {
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^ cannot return without recursing
30 |         self.packet()
   |         ------------- recursive call site
   |
   = help: a `loop` may express intention better if this is on purpose
   = note: `#[warn(unconditional_recursion)]` on by default

warning: function cannot return without recursing
  --> pnet_macros_support/src/packet.rs:34:5
   |
34 |     fn payload(&self) -> &[u8] {
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot return without recursing
35 |         self.payload()
   |         -------------- recursive call site
   |
   = help: a `loop` may express intention better if this is on purpose

warning: function cannot return without recursing
  --> pnet_macros_support/src/packet.rs:41:5
   |
41 |     fn packet(&self) -> &[u8] {
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^ cannot return without recursing
42 |         self.packet()
   |         ------------- recursive call site
   |
   = help: a `loop` may express intention better if this is on purpose

warning: function cannot return without recursing
  --> pnet_macros_support/src/packet.rs:46:5
   |
46 |     fn payload(&self) -> &[u8] {
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot return without recursing
47 |         self.payload()
   |         -------------- recursive call site
   |
   = help: a `loop` may express intention better if this is on purpose

@mrmonday mrmonday merged commit 4e9993c into master Feb 3, 2023
@mrmonday mrmonday deleted the revert-599-blanket_impls branch February 3, 2023 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant