mirror of
https://github.com/servo/servo.git
synced 2025-08-16 10:55:34 +01:00
Fix a bunch of clippy lints
This commit is contained in:
parent
b1ca3d1cdf
commit
6b215f38ee
58 changed files with 281 additions and 356 deletions
|
@ -649,8 +649,7 @@ mod system_reporter {
|
|||
// Note that the sum of all these segments' RSS values differs from the "resident"
|
||||
// measurement obtained via /proc/<pid>/statm in resident(). It's unclear why this
|
||||
// difference occurs; for some processes the measurements match, but for Servo they do not.
|
||||
let segs: Vec<(String, usize)> = seg_map.into_iter().collect();
|
||||
segs
|
||||
seg_map.into_iter().collect()
|
||||
}
|
||||
|
||||
#[cfg(not(target_os = "linux"))]
|
||||
|
|
|
@ -172,9 +172,10 @@ impl Profiler {
|
|||
let mut start_energy = read_energy_uj();
|
||||
loop {
|
||||
for _ in 0..loop_count {
|
||||
match run_ap_thread() {
|
||||
true => thread::sleep(Duration::from_millis(SLEEP_MS as u64)),
|
||||
false => return,
|
||||
if run_ap_thread() {
|
||||
thread::sleep(Duration::from_millis(SLEEP_MS as u64))
|
||||
} else {
|
||||
return
|
||||
}
|
||||
}
|
||||
let end_time = precise_time_ns();
|
||||
|
@ -258,7 +259,7 @@ impl Profiler {
|
|||
let data_len = data.len();
|
||||
if data_len > 0 {
|
||||
let (mean, median, min, max) =
|
||||
(data.iter().map(|&x|x).sum::<f64>() / (data_len as f64),
|
||||
(data.iter().sum::<f64>() / (data_len as f64),
|
||||
data[data_len / 2],
|
||||
data.iter().fold(f64::INFINITY, |a, &b| a.min(b)),
|
||||
data.iter().fold(-f64::INFINITY, |a, &b| a.max(b)));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue