Skip to content

Commit d6302eb

Browse files
committed
clippy
1 parent 83e6327 commit d6302eb

File tree

1 file changed

+11
-15
lines changed

1 file changed

+11
-15
lines changed

crates/libamdgpu_top/src/app_device_info.rs

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,7 @@ impl AppDeviceInfo {
109109
.and_then(|[_min, max]| u32::try_from(max).ok());
110110
} else if chip_class >= CHIP_CLASS::GFX10 && let Ok(s) = pp_od_clk_voltage {
111111
max_od_gpu_clk = Self::parse_od_sclk(&s)
112-
.and_then(|[_min, max]| u32::try_from(max).ok())
113-
.map(|v| v);
112+
.and_then(|[_min, max]| u32::try_from(max).ok());
114113
max_od_mem_clk = Self::parse_od_mclk(&s)
115114
.and_then(|[_min, max]| u32::try_from(max).ok());
116115
} else {
@@ -200,20 +199,17 @@ impl AppDeviceInfo {
200199
fn parse_range(s: &str, start_str: &str) -> Option<[i32; 2]> {
201200
let mut lines = s.lines();
202201
let s_range = lines.find(|l| l.starts_with(start_str))?;
203-
let range = {
204-
let mut split = s_range
205-
.trim_start_matches(start_str)
206-
.split_whitespace();
207-
if let [Some(min), Some(max)] = [split.next(), split.next()]
208-
.map(|v| v.and_then(Self::parse_mhz))
209-
{
210-
Some([min, max])
211-
} else {
212-
None
213-
}
214-
};
202+
let mut split = s_range
203+
.trim_start_matches(start_str)
204+
.split_whitespace();
215205

216-
range
206+
if let [Some(min), Some(max)] = [split.next(), split.next()]
207+
.map(|v| v.and_then(Self::parse_mhz))
208+
{
209+
Some([min, max])
210+
} else {
211+
None
212+
}
217213
}
218214

219215
fn parse_od_sclk(s: &str) -> Option<[i32; 2]> {

0 commit comments

Comments
 (0)