Skip to content

Commit 246ad8a

Browse files
committed
Remove unnecessary unwrap()s
1 parent 7e54451 commit 246ad8a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

collector/src/etw_parser.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -376,15 +376,15 @@ fn process_events(event_data: EventData) -> anyhow::Result<Counters> {
376376
/// Given the path to the ETW results file, process it and calculate the
377377
/// hardware performance counter totals for the rustc process.
378378
pub fn parse_etw_file(path: &str) -> anyhow::Result<Counters> {
379-
let mut file = std::io::BufReader::new(std::fs::File::open(path).unwrap());
379+
let mut file = std::io::BufReader::new(std::fs::File::open(path)?);
380380

381-
let headers = parse_header(&mut file).unwrap();
381+
let headers = parse_header(&mut file)?;
382382

383-
validate_os_header_line(&mut file).unwrap();
383+
validate_os_header_line(&mut file)?;
384384

385-
let events = parse_events(&mut file, headers).unwrap();
385+
let events = parse_events(&mut file, headers)?;
386386

387-
Ok(process_events(events).unwrap())
387+
Ok(process_events(events)?)
388388
}
389389

390390
#[cfg(test)]

0 commit comments

Comments
 (0)