bpf: Fix clippy warnings

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
pull/66/head
Dave Tucker 3 years ago committed by Alessandro Decina
parent 16b89fbe72
commit 090efc863d

@ -3,7 +3,7 @@ use std::env;
fn main() { fn main() {
if env::var("CARGO_CFG_BPF_TARGET_ARCH").is_err() { if env::var("CARGO_CFG_BPF_TARGET_ARCH").is_err() {
let arch = env::var("HOST").unwrap(); let arch = env::var("HOST").unwrap();
let arch = arch.splitn(2, '-').next().unwrap(); let arch = arch.split_once('-').map_or(&*arch, |x| x.0);
println!("cargo:rustc-cfg=bpf_target_arch=\"{}\"", arch); println!("cargo:rustc-cfg=bpf_target_arch=\"{}\"", arch);
} }
} }

@ -3,7 +3,7 @@ use std::env;
fn main() { fn main() {
if env::var("CARGO_CFG_BPF_TARGET_ARCH").is_err() { if env::var("CARGO_CFG_BPF_TARGET_ARCH").is_err() {
let arch = env::var("HOST").unwrap(); let arch = env::var("HOST").unwrap();
let arch = arch.splitn(2, '-').next().unwrap(); let arch = arch.split_once('-').map_or(&*arch, |x| x.0);
println!("cargo:rustc-cfg=bpf_target_arch=\"{}\"", arch); println!("cargo:rustc-cfg=bpf_target_arch=\"{}\"", arch);
} }
} }

Loading…
Cancel
Save