Skip to content

Commit

Permalink
Fixed unwrap on None bug
Browse files Browse the repository at this point in the history
  • Loading branch information
oskari1 committed Jan 8, 2024
1 parent 433a12b commit ab33478
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions smt-log-parser/src/display_with.rs
Original file line number Diff line number Diff line change
Expand Up @@ -241,9 +241,15 @@ impl<'a> DisplayWithCtxt<DisplayCtxt<'a>, DisplayData<'a>> for &'a Term {
) -> fmt::Result {
data.with_children(&self.child_ids, |data| {
if ctxt.display_term_ids {
let namespace = ctxt.parser.strings.resolve(&self.id.unwrap().namespace);
let id = self.id.unwrap().id.map(|id| id.to_string()).unwrap_or_default();
write!(f, "[{namespace}#{id}]")?;
match self.kind {
TermKind::GeneralizedTerm => {write!(f, "")?;}
_ => {
let namespace = ctxt.parser.strings.resolve(&self.id.unwrap().namespace);
let id = self.id.unwrap().id.map(|id| id.to_string()).unwrap_or_default();
write!(f, "[{namespace}#{id}]")?;
}
}

}
if let Some(meaning) = &self.meaning {
write!(f, "{}", meaning.with_data(ctxt, data))?;
Expand Down

0 comments on commit ab33478

Please sign in to comment.