Change Option<usize> to usize for variable resolver index.

This commit is contained in:
Stephen Chung
2020-10-11 22:41:26 +08:00
parent fd5a932611
commit e343bcfa8f
8 changed files with 68 additions and 29 deletions

View File

@@ -224,13 +224,13 @@ pub type Callback<T, R> = Box<dyn Fn(&T) -> R + Send + Sync + 'static>;
/// A standard callback function.
#[cfg(not(feature = "sync"))]
pub type OnVarCallback = Box<
dyn Fn(&str, Option<usize>, &Scope, &EvalContext) -> Result<Option<Dynamic>, Box<EvalAltResult>>
dyn Fn(&str, usize, &Scope, &EvalContext) -> Result<Option<Dynamic>, Box<EvalAltResult>>
+ 'static,
>;
/// A standard callback function.
#[cfg(feature = "sync")]
pub type OnVarCallback = Box<
dyn Fn(&str, Option<usize>, &Scope, &EvalContext) -> Result<Option<Dynamic>, Box<EvalAltResult>>
dyn Fn(&str, usize, &Scope, &EvalContext) -> Result<Option<Dynamic>, Box<EvalAltResult>>
+ Send
+ Sync
+ 'static,