Skip to content

Commit

Permalink
Let from_i64 use Into<i64>
Browse files Browse the repository at this point in the history
  • Loading branch information
Pat-Lafon committed Nov 10, 2023
1 parent 26ddf7f commit 76ad2fd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions z3/src/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -773,9 +773,9 @@ impl<'ctx> Int<'ctx> {
}
}

pub fn from_i64(ctx: &'ctx Context, i: i64) -> Int<'ctx> {
pub fn from_i64<T: Into<i64>>(ctx: &'ctx Context, i: T) -> Int<'ctx> {
let sort = Sort::int(ctx);
unsafe { Self::wrap(ctx, Z3_mk_int64(ctx.z3_ctx, i, sort.z3_sort)) }
unsafe { Self::wrap(ctx, Z3_mk_int64(ctx.z3_ctx, i.into(), sort.z3_sort)) }
}

pub fn from_u64(ctx: &'ctx Context, u: u64) -> Int<'ctx> {
Expand Down Expand Up @@ -1217,9 +1217,9 @@ impl<'ctx> BV<'ctx> {
}
}

pub fn from_i64(ctx: &'ctx Context, i: i64, sz: u32) -> BV<'ctx> {
pub fn from_i64<T: Into<i64>>(ctx: &'ctx Context, i: T, sz: u32) -> BV<'ctx> {
let sort = Sort::bitvector(ctx, sz);
unsafe { Self::wrap(ctx, Z3_mk_int64(ctx.z3_ctx, i, sort.z3_sort)) }
unsafe { Self::wrap(ctx, Z3_mk_int64(ctx.z3_ctx, i.into(), sort.z3_sort)) }
}

pub fn from_u64(ctx: &'ctx Context, u: u64, sz: u32) -> BV<'ctx> {
Expand Down

0 comments on commit 76ad2fd

Please sign in to comment.