mirror of
https://gitee.com/openharmony/third_party_rust_nix
synced 2025-01-09 00:40:46 +00:00
ae8e4a4ba0
As of Rust 1.17 'static lifetimes are implied when declaring consts.
13 lines
294 B
Rust
13 lines
294 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());
|
|
}
|