mirror of https://codeberg.org/topola/topola.git
fix(specctra/design): invalid references shouldn't panic during serialization
This commit is contained in:
parent
0a862a7e5f
commit
0b9d3c0a00
|
|
@ -135,7 +135,15 @@ impl SpecctraDesign {
|
|||
path: structure::Path {
|
||||
layer: mesadata
|
||||
.layer_layername(primitive.layer())
|
||||
.unwrap()
|
||||
.ok_or_else(|| {
|
||||
std::io::Error::new(
|
||||
std::io::ErrorKind::InvalidData,
|
||||
format!(
|
||||
"tried to reference invalid primitive layer {}",
|
||||
primitive.layer()
|
||||
),
|
||||
)
|
||||
})?
|
||||
.to_owned(),
|
||||
width: primitive.width(),
|
||||
coords,
|
||||
|
|
@ -148,7 +156,15 @@ impl SpecctraDesign {
|
|||
net_outs.insert(
|
||||
net,
|
||||
structure::NetOut {
|
||||
name: mesadata.net_netname(net).unwrap().to_owned(),
|
||||
name: mesadata
|
||||
.net_netname(net)
|
||||
.ok_or_else(|| {
|
||||
std::io::Error::new(
|
||||
std::io::ErrorKind::InvalidData,
|
||||
format!("tried to reference invalid net ID {}", net),
|
||||
)
|
||||
})?
|
||||
.to_owned(),
|
||||
wire: vec![wire],
|
||||
via: Vec::new(),
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
//! Module containing the informations about handling the Specctra
|
||||
//! based file format, and parsing it into Topola's objects
|
||||
#![forbid(unused_must_use)]
|
||||
#![forbid(clippy::panic_in_result_fn, clippy::unwrap_in_result)]
|
||||
|
||||
mod common;
|
||||
pub mod design;
|
||||
|
|
|
|||
Loading…
Reference in New Issue