Skip to content

Commit

Permalink
bug: remove unwrap from from_discrete_str
Browse files Browse the repository at this point in the history
  • Loading branch information
martinjrobins committed Nov 5, 2024
1 parent de1d438 commit 69db7a5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/execution/compiler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ impl<M: CodegenModule> Compiler<M> {
pub fn from_discrete_str(code: &str) -> Result<Self> {
let uid = Id::<u32>::new();
let name = format!("diffsl_{}", uid);
let model = parse_ds_string(code).unwrap();
let model = parse_ds_string(code).map_err(|e| anyhow!(e.to_string()))?;
let model = DiscreteModel::build(name.as_str(), &model).map_err(|e| anyhow!(e.as_error_message(code)))?;
Self::from_discrete_model(&model)
}
Expand Down

0 comments on commit 69db7a5

Please sign in to comment.