mirror of
https://github.com/kata-containers/cgroups-rs.git
synced 2026-08-05 02:13:23 +00:00
Fix clippy warnings
Fix clippy warnings. Signed-off-by: Tim Zhang <tim@hyper.sh>
This commit is contained in:
@@ -94,6 +94,7 @@ impl NetPrioController {
|
||||
}
|
||||
|
||||
/// A map of priorities for each network interface.
|
||||
#[allow(clippy::iter_nth_zero, clippy::unnecessary_unwrap)]
|
||||
pub fn ifpriomap(&self) -> Result<HashMap<String, u64>> {
|
||||
self.open_path("net_prio.ifpriomap", false)
|
||||
.and_then(|file| {
|
||||
@@ -105,6 +106,7 @@ impl NetPrioController {
|
||||
let mut acc = acc.unwrap();
|
||||
let l = line.unwrap();
|
||||
let mut sp = l.split_whitespace();
|
||||
|
||||
let ifname = sp.nth(0);
|
||||
let ifprio = sp.nth(1);
|
||||
if ifname.is_none() || ifprio.is_none() {
|
||||
|
||||
Reference in New Issue
Block a user