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 {
|
path: structure::Path {
|
||||||
layer: mesadata
|
layer: mesadata
|
||||||
.layer_layername(primitive.layer())
|
.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(),
|
.to_owned(),
|
||||||
width: primitive.width(),
|
width: primitive.width(),
|
||||||
coords,
|
coords,
|
||||||
|
|
@ -148,7 +156,15 @@ impl SpecctraDesign {
|
||||||
net_outs.insert(
|
net_outs.insert(
|
||||||
net,
|
net,
|
||||||
structure::NetOut {
|
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],
|
wire: vec![wire],
|
||||||
via: Vec::new(),
|
via: Vec::new(),
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
//! Module containing the informations about handling the Specctra
|
//! Module containing the informations about handling the Specctra
|
||||||
//! based file format, and parsing it into Topola's objects
|
//! 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;
|
mod common;
|
||||||
pub mod design;
|
pub mod design;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue