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

Add a wrapper around if_nameindex #1445

Merged
merged 1 commit into from Jun 6, 2021
Merged

Conversation

coolreader18
Copy link
Contributor

No description provided.

Copy link
Member

@asomers asomers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty good! Don't forget to add a CHANGELOG entry.

src/net/if_.rs Outdated Show resolved Hide resolved
src/net/if_.rs Outdated Show resolved Hide resolved
@coolreader18 coolreader18 force-pushed the if_nameindex branch 2 times, most recently from 7f88c6c to 2a02f0b Compare June 6, 2021 15:35
src/net/if_.rs Outdated
/// for iface in &interfaces {
/// println!("Interface #{} is called {}", iface.index(), iface.name().to_string_lossy());
/// }
/// # nix::Result::Ok(())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this works, but it would be in keeping with the style of the other doc tests if you return () here, and do an .unwrap() above instead of ?.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, alright, hadn't noticed that pattern.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, though note that the # means that line will be hidden from the docs; readers won't see that it returns Ok(())

Copy link
Member

@asomers asomers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

bors r+

@bors bors bot merged commit 99fc58e into nix-rust:master Jun 6, 2021
@coolreader18 coolreader18 deleted the if_nameindex branch June 6, 2021 17:23
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.

None yet

2 participants