From 9a96e3a49479a3047c82d2705b14e1a8168237c3 Mon Sep 17 00:00:00 2001 From: gwenn Date: Mon, 11 Jun 2018 19:51:13 +0200 Subject: [PATCH] Reduce visibility of unsafe methods --- src/context.rs | 4 ++-- src/vtab/mod.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/context.rs b/src/context.rs index 1febd27..e4ce95a 100644 --- a/src/context.rs +++ b/src/context.rs @@ -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), diff --git a/src/vtab/mod.rs b/src/vtab/mod.rs index 4c0b5fd..4c602e9 100644 --- a/src/vtab/mod.rs +++ b/src/vtab/mod.rs @@ -727,7 +727,7 @@ pub unsafe fn cursor_error(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); }