Skip to content

rustix::net::netdevice::index_to_name is returning String #1393

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

Open
al8n opened this issue Mar 7, 2025 · 1 comment · May be fixed by #1397
Open

rustix::net::netdevice::index_to_name is returning String #1393

al8n opened this issue Mar 7, 2025 · 1 comment · May be fixed by #1397
Labels
enhancement New feature or request

Comments

@al8n
Copy link
Contributor

al8n commented Mar 7, 2025

Hi, on the Linux and BSD platform, the max interface name length is 16, which is small enough to be inlined instead of a heap-allocated String.

If we change the returning type to an inlined array or somehow a wrapper over [u8; 16], we can remove the alloc requirement.

Image
@al8n al8n changed the title rustix::net::netdevice::id_to_name is returning String rustix::net::netdevice::index_to_name is returning String Mar 7, 2025
@sunfishcode sunfishcode added the enhancement New feature or request label Mar 7, 2025
@sunfishcode
Copy link
Member

We likely won't make any changes that would require a semver major-version bump for quite a while, but a PR adding a new function that implements this would be welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants