Skip to content

Commit

Permalink
Cast to c_char instead of i8 for more portable build (#394)
Browse files Browse the repository at this point in the history
Signed-off-by: John Kastner <[email protected]>
  • Loading branch information
john-h-kastner-aws authored Jul 16, 2024
1 parent 1f2928d commit 954d44a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cedar-drt/src/lean_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ use lean_sys::{
use log::info;
use miette::miette;
use serde::Deserialize;
use std::ffi::CStr;
use std::ffi::{c_char, CStr};
use std::str::FromStr;

#[link(name = "Cedar", kind = "static")]
Expand Down Expand Up @@ -120,7 +120,7 @@ pub struct LeanDefinitionalEngine {}

fn lean_obj_p_to_rust_string(lean_str_obj: *mut lean_object) -> String {
let lean_obj_p = unsafe { lean_string_cstr(lean_str_obj) };
let lean_obj_cstr = unsafe { CStr::from_ptr(lean_obj_p as *const i8) };
let lean_obj_cstr = unsafe { CStr::from_ptr(lean_obj_p as *const c_char) };
let rust_string = lean_obj_cstr
.to_str()
.expect("failed to convert Lean object to string")
Expand Down

0 comments on commit 954d44a

Please sign in to comment.