prove-rs / z3.rs

Rust bindings for the Z3 solver.
347 stars 110 forks source link

ref ast conversion into Dynamic #225

Closed Pat-Lafon closed 1 year ago

Pat-Lafon commented 1 year ago

I found myself making what I think are unnecessary clones when getting the dynamic versions of an Ast(while still holding onto the typed version of the Ast). I've added an additional From impl which I believe to be safe because Dynamic::as_{bool, int, real} do the inverse of this. https://github.com/prove-rs/z3.rs/blob/ee521b74bbe0e76113b2399e1a4640b3d6995181/z3/src/ast.rs#L1626-L1655

I also fixed a small copy-paste error.