Remove _result registration methods.
This commit is contained in:
@@ -315,11 +315,13 @@ fn test_get_set_indexer() -> Result<(), Box<EvalAltResult>> {
|
||||
engine
|
||||
.register_type_with_name::<MyMap>("MyMap")
|
||||
.register_fn("new_map", || MyMap::new())
|
||||
.register_indexer_get_result(|map: &mut MyMap, index: &str| {
|
||||
map.get(index).cloned().ok_or_else(|| {
|
||||
EvalAltResult::ErrorIndexNotFound(index.into(), rhai::Position::NONE).into()
|
||||
})
|
||||
})
|
||||
.register_indexer_get(
|
||||
|map: &mut MyMap, index: &str| -> Result<_, Box<EvalAltResult>> {
|
||||
map.get(index).cloned().ok_or_else(|| {
|
||||
EvalAltResult::ErrorIndexNotFound(index.into(), rhai::Position::NONE).into()
|
||||
})
|
||||
},
|
||||
)
|
||||
.register_indexer_set(|map: &mut MyMap, index: &str, value: INT| {
|
||||
map.insert(index.to_string(), value);
|
||||
});
|
||||
|
Reference in New Issue
Block a user