mirror of
https://github.com/servo/servo.git
synced 2025-08-17 19:35:33 +01:00
replace match by if let statements if possible
This commit is contained in:
parent
608511ddc3
commit
b78979d692
7 changed files with 39 additions and 58 deletions
|
@ -262,12 +262,11 @@ impl Profiler {
|
|||
// send using the inner channel
|
||||
// (using ProfilerChan.send() forces an unwrap and sometimes panics for this background profiler)
|
||||
let ProfilerChan(ref c) = profiler_chan;
|
||||
match c.send(ProfilerMsg::Time((ProfilerCategory::ApplicationHeartbeat, None),
|
||||
(start_time, end_time),
|
||||
(start_energy, end_energy))) {
|
||||
Ok(_) => {},
|
||||
Err(_) => return,
|
||||
};
|
||||
if let Err(_) = c.send(ProfilerMsg::Time((ProfilerCategory::ApplicationHeartbeat, None),
|
||||
(start_time, end_time),
|
||||
(start_energy, end_energy))) {
|
||||
return;
|
||||
}
|
||||
start_time = end_time;
|
||||
start_energy = end_energy;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue