Add docs and tests for switch.

This commit is contained in:
Stephen Chung
2020-11-14 09:38:16 +08:00
parent b0c66eb5e5
commit 83c7c101d1
5 changed files with 155 additions and 14 deletions

View File

@@ -191,3 +191,10 @@ engine.register_fn("==",
let item = new_ts(); // construct a new 'TestStruct'
item in array; // 'in' operator uses '=='
```
Working With Enums
------------------
It is quite easy to use Rust enums with Rhai.
See [this chapter]({{rootUrl}}/patterns/enums.md) for more details.