From 2fbc1b791043b63b72b79049b2b7e9a3d3a32972 Mon Sep 17 00:00:00 2001 From: Stephen Chung Date: Mon, 24 Aug 2020 10:38:15 +0800 Subject: [PATCH] Add missing pub to functions. --- src/packages/arithmetic.rs | 6 +++--- src/packages/fn_basic.rs | 4 ++-- src/packages/time_basic.rs | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/packages/arithmetic.rs b/src/packages/arithmetic.rs index 10d33f8e..ae203782 100644 --- a/src/packages/arithmetic.rs +++ b/src/packages/arithmetic.rs @@ -197,17 +197,17 @@ macro_rules! gen_arithmetic_functions { } #[rhai_fn(name = "&")] #[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 } #[rhai_fn(name = "|")] #[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 } #[rhai_fn(name = "^")] #[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 } } diff --git a/src/packages/fn_basic.rs b/src/packages/fn_basic.rs index 274b85e1..bb3835d7 100644 --- a/src/packages/fn_basic.rs +++ b/src/packages/fn_basic.rs @@ -9,13 +9,13 @@ def_package!(crate:BasicFnPackage:"Basic Fn functions.", lib, { #[export_module] mod fn_ptr_functions { #[inline(always)] - fn name(f: &mut FnPtr) -> ImmutableString { + pub fn name(f: &mut FnPtr) -> ImmutableString { f.get_fn_name().clone() } #[rhai_fn(get = "name")] #[inline(always)] - fn name_prop(f: &mut FnPtr) -> ImmutableString { + pub fn name_prop(f: &mut FnPtr) -> ImmutableString { name(f) } } diff --git a/src/packages/time_basic.rs b/src/packages/time_basic.rs index d1401288..5b8e1f21 100644 --- a/src/packages/time_basic.rs +++ b/src/packages/time_basic.rs @@ -66,7 +66,7 @@ mod time_functions { } #[rhai_fn(return_raw, name = "-")] - fn time_diff(ts1: Instant, ts2: Instant) -> Result> { + pub fn time_diff(ts1: Instant, ts2: Instant) -> Result> { #[cfg(not(feature = "no_float"))] { Ok(if ts2 > ts1 {