File tree Expand file tree Collapse file tree 4 files changed +9
-5
lines changed
Expand file tree Collapse file tree 4 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -193,7 +193,7 @@ jobs:
193193 with :
194194 components : rustfmt
195195 - uses : Swatinem/rust-cache@v2
196- - run : cargo clippy --locked --no-deps --all-targets --tests -- -D warnings
196+ - run : cargo clippy --locked --no-deps --all-targets --tests -- -D warnings -D clippy::absolute_paths
197197 rustfmt :
198198 name : Check code formatting
199199 runs-on : ubuntu-latest
Original file line number Diff line number Diff line change 44//
55// Based on capable(8) by Brendan Gregg
66use core:: time:: Duration ;
7+ use std:: str;
78use std:: str:: FromStr ;
89
910use anyhow:: bail;
@@ -145,7 +146,7 @@ fn _handle_event(opts: Command, event: capable_types::event) {
145146 "00:00:00" . to_string ( )
146147 } ;
147148
148- let comm_str = std :: str:: from_utf8 ( & event. comm )
149+ let comm_str = str:: from_utf8 ( & event. comm )
149150 . unwrap ( )
150151 . trim_end_matches ( char:: from ( 0 ) ) ;
151152 let cap_name = match CAPS . get ( & event. cap ) {
Original file line number Diff line number Diff line change 11// SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause)
22
3- use core:: time:: Duration ;
3+ use std:: str;
4+ use std:: time:: Duration ;
45
56use anyhow:: bail;
67use anyhow:: Result ;
@@ -66,7 +67,7 @@ fn handle_event(_cpu: i32, data: &[u8]) {
6667 "00:00:00" . to_string ( )
6768 } ;
6869
69- let task = std :: str:: from_utf8 ( & event. task ) . unwrap ( ) ;
70+ let task = str:: from_utf8 ( & event. task ) . unwrap ( ) ;
7071
7172 println ! (
7273 "{:8} {:16} {:<7} {:<14}" ,
Original file line number Diff line number Diff line change @@ -18,6 +18,8 @@ use libbpf_rs::TC_H_CLSACT;
1818use libbpf_rs:: TC_H_MIN_INGRESS ;
1919use libbpf_rs:: TC_INGRESS ;
2020
21+ use nix:: net:: if_:: if_nametoindex;
22+
2123mod tc {
2224 include ! ( concat!( env!( "CARGO_MANIFEST_DIR" ) , "/src/bpf/tc.skel.rs" ) ) ;
2325}
@@ -71,7 +73,7 @@ fn main() -> Result<()> {
7173 let open = builder. open ( ) ?;
7274 let mut skel = open. load ( ) ?;
7375 let progs = skel. progs ( ) ;
74- let ifidx = nix :: net :: if_ :: if_nametoindex ( opts. iface . as_str ( ) ) ? as i32 ;
76+ let ifidx = if_nametoindex ( opts. iface . as_str ( ) ) ? as i32 ;
7577
7678 let mut tc_builder = TcHookBuilder :: new ( progs. handle_tc ( ) . as_fd ( ) ) ;
7779 tc_builder
You can’t perform that action at this time.
0 commit comments