Stephen Chung
a9b6e8b98c
Fix builds.
2022-08-18 21:16:42 +08:00
Stephen Chung
5f2262214d
Add docs.
2022-08-14 18:16:35 +08:00
Stephen Chung
3cb66b7e23
Fix bug.
2022-08-12 16:44:13 +08:00
Stephen Chung
5ba9b3bd1c
Optimize Dynamic::is.
2022-08-12 12:48:35 +08:00
Stephen Chung
255af006ee
Fix doc comments.
2022-08-10 12:48:37 +08:00
Stephen Chung
2f948a784c
Clean up more clippy.
2022-07-27 18:04:59 +08:00
Stephen Chung
39dee556c4
Clean up clippy.
2022-07-27 16:04:24 +08:00
quake
299777f1c9
chore: clippy fix needless_borrow
2022-07-20 21:16:35 +09:00
quake
4033543309
chore: remove clippy redundant_allocation since it has been resolved in clippy#7592
2022-07-20 17:05:05 +09:00
Stephen Chung
d9875ff81c
Fix sync feature.
2022-06-26 17:14:10 +08:00
Stephen Chung
335957fbc2
Enable modifying constant shared values.
2022-06-26 17:04:08 +08:00
Stephen Chung
7068775f19
Use locked_read.
2022-06-26 14:10:09 +08:00
Stephen Chung
addb579f30
Streamline Dynamic.
2022-06-17 23:36:18 +08:00
Stephen Chung
dcaac20eb9
Strict mode in functions check for static modules.
2022-06-09 17:59:28 +08:00
Stephen Chung
2a57bd9d25
Mark some types as non_exhaustive.
2022-05-03 21:55:08 +08:00
Stephen Chung
63359f3f81
Unused parameters naming.
2022-04-11 16:29:16 +08:00
Stephen Chung
5caf20d26b
Search for global variables in global modules.
2022-03-27 21:49:34 +08:00
Stephen Chung
fefa633cf0
Add type alias support for plugin modules.
2022-03-19 09:43:18 +08:00
Stephen Chung
14e23ed74c
Fix sync build.
2022-03-03 13:14:35 +08:00
Stephen Chung
0e9a16e437
Add checks for is_empty.
2022-03-03 13:02:57 +08:00
Stephen Chung
83755bf936
Refine doc comments.
2022-03-01 15:34:15 +08:00
Stephen Chung
73f10b8adc
Minor housekeeping.
2022-02-24 10:36:20 +08:00
Stephen Chung
97a8fd3d5b
Improve reify syntax.
2022-02-08 09:25:53 +08:00
Stephen Chung
f8cee0fe4e
Simplify using ..
2022-02-08 09:02:15 +08:00
Stephen Chung
bd9519e96b
Remove reify_dynamic.
2022-02-07 12:02:00 +08:00
Stephen Chung
becbfa8930
Fix errors.
2022-02-06 23:02:59 +08:00
Nathan Kent
86d86a85e4
Remove unsound casting functions
...
The casting functions in `unsafe.rs` were unsound (i.e., they allowed
safe code to cause undefined behavior). While they did appear to be used
in a way that wouldn't cause UB the fact that there exists unsound
functions is unsettling.
This commit removes those functions and replaces it with a macro that
performs the same reification - the difference is that the macro call
will also include the checks which are required to prevent UB. A macro
was chosen instead of a function for two reasons:
1. A macro can keep the same code generation whereas a function would
require going through an `Option` which has negative impacts on code
generation (niche values cause poor DCE).
2. There exist other `unsafe` code blocks in the crate and an attempt to
make Rhai 100% safe is completely out-of-scope for this merge
request, so we may as well use `unsafe` in the macro.
Regarding (2) above, I may come back at a later date with a 100% safe
`reify` function but only once the other `unsafe` blocks are removed.
For posterity, said function would look something like:
```rust
fn reify<A: Any, C>(value: A) -> Option<C> {
let mut v = Some(value);
let v: &mut dyn Any = &mut v;
v.downcast_mut::<Option<C>>().map(Option::take)
}
```
2022-02-05 16:29:05 -08:00
Stephen Chung
345a060672
Fix type name display.
2022-02-03 23:54:53 +08:00
Stephen Chung
66af69aaff
Refactor and add state to debugger.
2022-01-28 18:59:18 +08:00
Stephen Chung
86fc2f7bf1
Refine types display.
2022-01-17 21:51:04 +08:00
Stephen Chung
37dbc68bf5
Use target_family for wasm.
2022-01-12 08:12:28 +08:00
Stephen Chung
b1b4361d08
Fix documentation.
2022-01-06 10:19:25 +08:00
magnus
7bf517b242
Fix documentation
2022-01-06 10:18:02 +08:00
Stephen Chung
328f6910b6
Refactor wasm feature gates.
2022-01-04 22:16:20 +08:00
Stephen Chung
d60f14ec27
Streamline hot code.
2022-01-03 23:11:06 +08:00
Stephen Chung
29f1328087
Simplify Dynamic::from for better inlining.
2022-01-02 20:47:03 +08:00
Stephen Chung
d60ed5a502
Reduce size of Variant trait.
2022-01-01 19:54:46 +08:00
Stephen Chung
64bf2eef5c
Better error messages.
2021-12-30 12:19:41 +08:00
Stephen Chung
b4756b4575
Move CallableFunction to own file.
2021-12-20 22:13:00 +08:00
Stephen Chung
e507dcfcb4
Fix no_index build.
2021-12-18 18:44:08 +08:00
Stephen Chung
82d3375fc0
Fix Dynamic::from for BLOB.
2021-12-18 15:36:30 +08:00
Stephen Chung
1c1247ac9a
Tidy up code.
2021-12-18 12:28:56 +08:00
Stephen Chung
f92cbe1f6d
Merge branch 'v1.3-fixes'
2021-12-16 16:10:39 +08:00
Stephen Chung
ef14079c61
Add ranges.
2021-12-15 12:06:17 +08:00
Stephen Chung
93e3c4c10a
Compact BLOB display.
2021-12-13 09:40:43 +08:00
Stephen Chung
2a7a648429
Reduce feature gates.
2021-12-06 20:52:47 +08:00
Stephen Chung
9a5bd9396a
Fix builds.
2021-12-02 17:46:39 +08:00
Stephen Chung
41dd989866
Support deserialization into byte arrays for BLOB's via serde_bytes.
2021-12-02 14:10:53 +08:00
Stephen Chung
dca47d5233
Remove volatile warnings for types and functions exposed unter internals.
2021-11-28 22:03:02 +08:00
Stephen Chung
a757dfe89d
Add blobs.
2021-11-23 14:58:54 +08:00