Reduce visibility of unsafe methods

This commit is contained in:
gwenn 2018-06-11 19:51:13 +02:00
parent b8594a0f83
commit 9a96e3a494
2 changed files with 3 additions and 3 deletions

View File

@ -15,7 +15,7 @@ use types::{ToSqlOutput, ValueRef};
use vtab::array::{free_array, ARRAY_TYPE};
impl<'a> ValueRef<'a> {
pub unsafe fn from_value(value: *mut sqlite3_value) -> ValueRef<'a> {
pub(crate) unsafe fn from_value(value: *mut sqlite3_value) -> ValueRef<'a> {
use std::slice::from_raw_parts;
match ffi::sqlite3_value_type(value) {
@ -63,7 +63,7 @@ impl<'a> ValueRef<'a> {
}
}
pub unsafe fn set_result<'a>(ctx: *mut sqlite3_context, result: &ToSqlOutput<'a>) {
pub(crate) unsafe fn set_result<'a>(ctx: *mut sqlite3_context, result: &ToSqlOutput<'a>) {
let value = match *result {
ToSqlOutput::Borrowed(v) => v,
ToSqlOutput::Owned(ref v) => ValueRef::from(v),

View File

@ -727,7 +727,7 @@ pub unsafe fn cursor_error<T>(cursor: *mut ffi::sqlite3_vtab_cursor, result: Res
}
/// Virtual tables methods can set an error message by assigning a string to `zErrMsg`.
pub unsafe fn set_err_msg(vtab: *mut ffi::sqlite3_vtab, err_msg: &str) {
unsafe fn set_err_msg(vtab: *mut ffi::sqlite3_vtab, err_msg: &str) {
if !(*vtab).zErrMsg.is_null() {
ffi::sqlite3_free((*vtab).zErrMsg as *mut c_void);
}