Add missing pub to functions.

This commit is contained in:
Stephen Chung 2020-08-24 10:38:15 +08:00
parent 03237c9852
commit 2fbc1b7910
3 changed files with 6 additions and 6 deletions

View File

@ -197,17 +197,17 @@ macro_rules! gen_arithmetic_functions {
} }
#[rhai_fn(name = "&")] #[rhai_fn(name = "&")]
#[inline(always)] #[inline(always)]
fn binary_and(x: $arg_type, y: $arg_type) -> $arg_type { pub fn binary_and(x: $arg_type, y: $arg_type) -> $arg_type {
x & y x & y
} }
#[rhai_fn(name = "|")] #[rhai_fn(name = "|")]
#[inline(always)] #[inline(always)]
fn binary_or(x: $arg_type, y: $arg_type) -> $arg_type { pub fn binary_or(x: $arg_type, y: $arg_type) -> $arg_type {
x | y x | y
} }
#[rhai_fn(name = "^")] #[rhai_fn(name = "^")]
#[inline(always)] #[inline(always)]
fn binary_xor(x: $arg_type, y: $arg_type) -> $arg_type { pub fn binary_xor(x: $arg_type, y: $arg_type) -> $arg_type {
x ^ y x ^ y
} }
} }

View File

@ -9,13 +9,13 @@ def_package!(crate:BasicFnPackage:"Basic Fn functions.", lib, {
#[export_module] #[export_module]
mod fn_ptr_functions { mod fn_ptr_functions {
#[inline(always)] #[inline(always)]
fn name(f: &mut FnPtr) -> ImmutableString { pub fn name(f: &mut FnPtr) -> ImmutableString {
f.get_fn_name().clone() f.get_fn_name().clone()
} }
#[rhai_fn(get = "name")] #[rhai_fn(get = "name")]
#[inline(always)] #[inline(always)]
fn name_prop(f: &mut FnPtr) -> ImmutableString { pub fn name_prop(f: &mut FnPtr) -> ImmutableString {
name(f) name(f)
} }
} }

View File

@ -66,7 +66,7 @@ mod time_functions {
} }
#[rhai_fn(return_raw, name = "-")] #[rhai_fn(return_raw, name = "-")]
fn time_diff(ts1: Instant, ts2: Instant) -> Result<Dynamic, Box<EvalAltResult>> { pub fn time_diff(ts1: Instant, ts2: Instant) -> Result<Dynamic, Box<EvalAltResult>> {
#[cfg(not(feature = "no_float"))] #[cfg(not(feature = "no_float"))]
{ {
Ok(if ts2 > ts1 { Ok(if ts2 > ts1 {