Alan Somers 7b7d954005 misc Clippy cleanup
* Fix race conditions in the tests.  Two tests were grabbing a mutex but
  immediately dropping it.  Thank you, Clippy.

* Remove vestigial Windows support.  Remove some code added to support
  Windows in 2015.  Nix is no longer intended to ever run on Windows.

* Various other minor Clippy lints.
2021-05-30 20:12:41 -06:00

13 lines
289 B
Rust

use nix::net::if_::*;
#[cfg(any(target_os = "android", target_os = "linux"))]
const LOOPBACK: &[u8] = b"lo";
#[cfg(not(any(target_os = "android", target_os = "linux")))]
const LOOPBACK: &[u8] = b"lo0";
#[test]
fn test_if_nametoindex() {
assert!(if_nametoindex(LOOPBACK).is_ok());
}