Skip to content

Commit

Permalink
chore(model): add From<...> implementations for converting literals…
Browse files Browse the repository at this point in the history
… to `Cst`
  • Loading branch information
arbimo committed Jun 14, 2024
1 parent 2550995 commit a1ade37
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions solver/src/model/lang/cst.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,27 @@ impl TryFrom<Atom> for Cst {
}
}
}

impl From<IntCst> for Cst {
fn from(value: IntCst) -> Self {
Cst::Int(value)
}
}

impl From<Rational32> for Cst {
fn from(value: Rational32) -> Self {
Cst::Fixed(value)
}
}

impl From<bool> for Cst {
fn from(value: bool) -> Self {
Cst::Bool(value)
}
}

impl From<TypedSym> for Cst {
fn from(value: TypedSym) -> Self {
Cst::Sym(value)
}
}

0 comments on commit a1ade37

Please sign in to comment.