Fix breakage due to write_lock()

This commit is contained in:
J Henry Waugh
2020-08-06 18:36:15 -05:00
parent 6475e4e20e
commit be315aebaf
5 changed files with 10 additions and 8 deletions

View File

@@ -39,10 +39,10 @@ pub trait RegisterPlugin<PL: crate::plugin::Plugin> {
/// fn is_varadic(&self) -> bool { false }
///
/// fn call(&self, args: &mut[&mut Dynamic], pos: Position) -> Result<Dynamic, Box<EvalAltResult>> {
/// let x1: &FLOAT = args[0].downcast_ref::<FLOAT>().unwrap();
/// let y1: &FLOAT = args[1].downcast_ref::<FLOAT>().unwrap();
/// let x2: &FLOAT = args[2].downcast_ref::<FLOAT>().unwrap();
/// let y2: &FLOAT = args[3].downcast_ref::<FLOAT>().unwrap();
/// let x1: FLOAT = args[0].downcast_clone::<FLOAT>().unwrap();
/// let y1: FLOAT = args[1].downcast_clone::<FLOAT>().unwrap();
/// let x2: FLOAT = args[2].downcast_clone::<FLOAT>().unwrap();
/// let y2: FLOAT = args[3].downcast_clone::<FLOAT>().unwrap();
/// let square_sum = (y2 - y1).abs().powf(2.0) + (x2 -x1).abs().powf(2.0);
/// Ok(Dynamic::from(square_sum.sqrt()))
/// }

View File

@@ -102,6 +102,8 @@ pub use rhai_codegen::*;
#[cfg(not(feature = "no_function"))]
pub use parser::FnAccess;
#[cfg(feature = "no_function")]
pub use parser::FnAccess;
#[cfg(not(feature = "no_function"))]
pub use fn_func::Func;