Change version to 0.15.1.

This commit is contained in:
Stephen Chung 2020-06-10 22:28:50 +08:00
parent 95f94a3348
commit 13cde456e5
4 changed files with 17 additions and 14 deletions

View File

@ -1,6 +1,6 @@
[package]
name = "rhai"
version = "0.16.0"
version = "0.15.1"
edition = "2018"
authors = ["Jonathan Turner", "Lukáš Hozda", "Stephen Chung"]
description = "Embedded scripting for Rust"

View File

@ -37,7 +37,7 @@ Features
to do checked arithmetic operations); for [`no-std`](#optional-features) builds, a number of additional dependencies are
pulled in to provide for functionalities that used to be in `std`.
**Note:** Currently, the version is `0.16.0`, so the language and API's may change before they stabilize.
**Note:** Currently, the version is `0.15.1`, so the language and API's may change before they stabilize.
What Rhai doesn't do
--------------------
@ -71,7 +71,7 @@ Install the Rhai crate on [`crates.io`](https::/crates.io/crates/rhai/) by addin
```toml
[dependencies]
rhai = "0.16.0"
rhai = "0.15.1"
```
Use the latest released crate version on [`crates.io`](https::/crates.io/crates/rhai/):
@ -315,7 +315,7 @@ Functions declared with `private` are hidden and cannot be called from Rust (see
```rust
// Define functions in a script.
let ast = engine.compile(true,
r"
r#"
// a function with two parameters: String and i64
fn hello(x, y) {
x.len + y
@ -335,7 +335,7 @@ let ast = engine.compile(true,
private hidden() {
throw "you shouldn't see me!";
}
")?;
"#)?;
// A custom scope can also contain any variables/constants available to the functions
let mut scope = Scope::new();
@ -522,7 +522,7 @@ The following primitive types are supported natively:
| **Floating-point number** (disabled with [`no_float`]) | `f32`, `f64` _(default)_ | `"f32"` or `"f64"` | `"123.4567"` etc. |
| **Boolean value** | `bool` | `"bool"` | `"true"` or `"false"` |
| **Unicode character** | `char` | `"char"` | `"A"`, `"x"` etc. |
| **Immutable Unicode string** | `rhai::ImmutableString` (implemented as `Rc<String>` or `Arc<String>`, _not_ `&str`) | `"string"` | `"hello"` etc. |
| **Immutable Unicode string** | `rhai::ImmutableString` (implemented as `Rc<String>` or `Arc<String>`) | `"string"` | `"hello"` etc. |
| **Array** (disabled with [`no_index`]) | `rhai::Array` | `"array"` | `"[ ?, ?, ? ]"` |
| **Object map** (disabled with [`no_object`]) | `rhai::Map` | `"map"` | `#{ "a": 1, "b": 2 }` |
| **Timestamp** (implemented in the [`BasicTimePackage`](#packages)) | `std::time::Instant` | `"timestamp"` | _not supported_ |
@ -1039,13 +1039,13 @@ struct TestStruct {
field: String
}
// Remember Rhai uses 'ImmutableString' instead of 'String'
impl TestStruct {
fn get_field(&mut self) -> ImmutableString {
// Make an 'ImmutableString' from a 'String'
self.field.into(0)
// Returning a 'String' is OK - Rhai converts it into 'ImmutableString'
fn get_field(&mut self) -> String {
self.field.clone()
}
// Remember Rhai uses 'ImmutableString' or '&str' instead of 'String'
fn set_field(&mut self, new_val: ImmutableString) {
// Get a 'String' from an 'ImmutableString'
self.field = (*new_val).clone();

View File

@ -1,9 +1,12 @@
Rhai Release Notes
==================
Version 0.16.0
Version 0.15.1
==============
This is a minor release which enables updating indexers (via registered indexer setters) and supports functions
with `&str` parameters (maps transparently to `ImmutableString`).
Breaking changes
----------------
@ -14,13 +17,15 @@ Breaking changes
New features
------------
* Indexers are now split into getters ans setters (which now support updates). The API is split into `Engine::register_indexer_get` and `Engine::register_indexer_set` with `Engine::register_indexer_get_set` being a shorthand. Similarly, `Module::set_indexer_get_fn` and `Module::set_indexer_set_fn` are added.
* Indexers are now split into getters and setters (which now support updates). The API is split into `Engine::register_indexer_get` and `Engine::register_indexer_set` with `Engine::register_indexer_get_set` being a shorthand. Similarly, `Module::set_indexer_get_fn` and `Module::set_indexer_set_fn` are added.
* `Engine:register_fn` and `Engine:register_result_fn` accepts functions that take parameters of type `&str` (immutable string slice), which maps directly to `ImmutableString`. This is to avoid needing wrappers for functions taking string parameters.
Version 0.15.0
==============
This version uses immutable strings (`ImmutableString` type) and built-in operator functions (e.g. `+`, `>`, `+=`) to improve speed, plus some bug fixes.
Regression fix
--------------

View File

@ -74,6 +74,4 @@ fn main() -> Result<(), Box<EvalAltResult>> {
println!();
}
Ok(())
}