Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

smoltcp::Device implementation can be for EthernetDMA instead of &mut EthernetDMA #86

Open
datdenkikniet opened this issue Jul 28, 2023 · 0 comments

Comments

@datdenkikniet
Copy link
Contributor

The current implementation still has the following signature:

impl<'a, 'rx, 'tx> smoltcp::Device for &'a mut EthernetDMA<'rx, 'tx> {}

However, the 'a lifetime is completely unused. We could change the impl to

impl<'rx, 'tx> smoltcp::Device for EthernetDMA<'rx, 'tx> {}

We should investigate whether this is still necessary (unlikely), or if it is just an artifact from how the Device trait worked in smoltcp 0.8 and older (likely).

Removing that lifetime and impl-ing directly for EthernetDMA would also remove the current oddness w.r.t. requiring that an &mut &mut EthernetDMA is passed to smoltcp functions.

@datdenkikniet datdenkikniet changed the title New smoltcp::Device implementation can be for EthernetDMA instead of &mut EthernetDMA smoltcp::Device implementation can be for EthernetDMA instead of &mut EthernetDMA Jul 28, 2023
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

No branches or pull requests

1 participant