Add Dynamic::UNIT.

This commit is contained in:
Stephen Chung
2020-11-15 23:14:29 +08:00
parent 937b45a187
commit b75964e383
17 changed files with 34 additions and 26 deletions

View File

@@ -150,7 +150,7 @@ mod time_functions {
#[rhai_fn(return_raw, name = "+=")]
pub fn add_assign(x: &mut Instant, seconds: FLOAT) -> Result<Dynamic, Box<EvalAltResult>> {
*x = add_impl(*x, seconds)?;
Ok(().into())
Ok(Dynamic::UNIT)
}
#[rhai_fn(return_raw, name = "-")]
pub fn subtract(x: Instant, seconds: FLOAT) -> Result<Dynamic, Box<EvalAltResult>> {
@@ -162,7 +162,7 @@ mod time_functions {
seconds: FLOAT,
) -> Result<Dynamic, Box<EvalAltResult>> {
*x = subtract_impl(*x, seconds)?;
Ok(().into())
Ok(Dynamic::UNIT)
}
}
@@ -204,7 +204,7 @@ mod time_functions {
#[rhai_fn(return_raw, name = "+=")]
pub fn add_assign(x: &mut Instant, seconds: INT) -> Result<Dynamic, Box<EvalAltResult>> {
*x = add_impl(*x, seconds)?;
Ok(().into())
Ok(Dynamic::UNIT)
}
#[rhai_fn(return_raw, name = "-")]
pub fn subtract(x: Instant, seconds: INT) -> Result<Dynamic, Box<EvalAltResult>> {
@@ -213,7 +213,7 @@ mod time_functions {
#[rhai_fn(return_raw, name = "-=")]
pub fn subtract_assign(x: &mut Instant, seconds: INT) -> Result<Dynamic, Box<EvalAltResult>> {
*x = subtract_impl(*x, seconds)?;
Ok(().into())
Ok(Dynamic::UNIT)
}
#[rhai_fn(name = "==")]