diff --git a/dojo.h b/dojo.h index b38b227..dea7dbd 100644 --- a/dojo.h +++ b/dojo.h @@ -29,7 +29,7 @@ typedef struct CJsonRpcClient CJsonRpcClient; typedef struct ToriiClient ToriiClient; typedef struct Error { - const char *message; + char *message; } Error; typedef enum Result_____ToriiClient_Tag { diff --git a/src/lib.rs b/src/lib.rs index 5da90ff..2e7bb8e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -490,7 +490,7 @@ pub unsafe extern "C" fn entity_free(entity: *mut Entity) { #[allow(clippy::missing_safety_doc)] pub unsafe extern "C" fn error_free(error: *mut Error) { if !error.is_null() { - let _: String = CString::from_raw((*error).message as *mut i8) + let _: String = CString::from_raw((*error).message) .into_string() .unwrap(); } diff --git a/src/types.rs b/src/types.rs index 1732163..b9ff9f5 100644 --- a/src/types.rs +++ b/src/types.rs @@ -171,7 +171,7 @@ pub struct CHashItem { #[derive(Debug, Clone)] #[repr(C)] pub struct Error { - pub message: *const c_char, + pub message: *mut c_char, } #[derive(Clone, Debug)]