From 260f191246f7ad48008eaaf86b026af96de386a8 Mon Sep 17 00:00:00 2001 From: jonathanrainer Date: Tue, 15 Oct 2024 14:24:57 +0100 Subject: [PATCH] FLEET-19 Fix clippies --- apollo-router/src/plugins/fleet_detector.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/apollo-router/src/plugins/fleet_detector.rs b/apollo-router/src/plugins/fleet_detector.rs index 8e00a7fc75e..747538e26c8 100644 --- a/apollo-router/src/plugins/fleet_detector.rs +++ b/apollo-router/src/plugins/fleet_detector.rs @@ -54,7 +54,7 @@ impl FleetDetector { // 'cgroups' let fses: HashSet<&str> = filesystems_file .split('\n') - .map(|x| x.trim().split_whitespace().next().unwrap()) + .map(|x| x.split_whitespace().next().unwrap()) .filter(|x| x.contains("cgroup")) .collect(); @@ -68,9 +68,8 @@ impl FleetDetector { system_cpus } else { // If it's not max then divide the two to get an integer answer - let (a, b) = readings.split_once(" ").unwrap(); - let result = a.parse::().unwrap() / b.parse::().unwrap(); - result + let (a, b) = readings.split_once(' ').unwrap(); + a.parse::().unwrap() / b.parse::().unwrap(); } } Err(_) => system_cpus, @@ -90,8 +89,7 @@ impl FleetDetector { if quota == "-1" { system_cpus } else { - let result = quota.parse::().unwrap() / period.parse::().unwrap(); - result + quota.parse::().unwrap() / period.parse::().unwrap(); } } _ => system_cpus,