Skip to content

Commit

Permalink
Merge pull request #13 from oscargus/returnerror
Browse files Browse the repository at this point in the history
Return if error, rather than explicit unwrap
  • Loading branch information
ekiwi authored May 3, 2024
2 parents befbd10 + 4e0a4c6 commit ab30364
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/vcd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ fn read_hierarchy(
Ok(())
}
HeaderCmd::Timescale(factor, unit) => {
let factor_int = u32::from_str_radix(std::str::from_utf8(factor).unwrap(), 10).unwrap();
let factor_int = u32::from_str_radix(std::str::from_utf8(factor).unwrap(), 10)?;
let value = Timescale::new(factor_int, convert_timescale_unit(unit));
h.set_timescale(value);
Ok(())
Expand All @@ -297,7 +297,7 @@ fn read_hierarchy(
}
};

read_vcd_header(input, foo).unwrap();
read_vcd_header(input, foo)?;
let end = input.stream_position().unwrap();
let hierarchy = h.finish();
let lookup = if use_id_map { Some(id_map) } else { None };
Expand Down

0 comments on commit ab30364

Please sign in to comment.