add full api to engine (#50)

Signed-off-by: eric-therond <eric.therond.fr@gmail.com>
This commit is contained in:
eric-therond
2023-11-27 18:08:40 +01:00
committed by GitHub
parent 3514594c56
commit ef36d9bed5
6 changed files with 171 additions and 173 deletions

View File

@@ -78,8 +78,7 @@ fn range(span: &Span, params: &[Ref<Expr>], args: &[Value]) -> Result<Value> {
}
let incr = if v2 >= v1 { 1 } else { -1 } as Float;
let mut values = vec![];
values.reserve((v2 - v1).abs() as usize + 1);
let mut values = Vec::with_capacity((v2 - v1).abs() as usize + 1);
let mut v = v1;
while v != v2 {