Fix the retrieval of the doc in scope

This commit is contained in:
Clément Renault 2025-04-21 12:52:42 +02:00
parent c8b7822d0d
commit 44586e089d
No known key found for this signature in database
GPG Key ID: F250A4C4E3AE5F5F

View File

@ -431,7 +431,7 @@ impl<'doc> Versions<'doc> {
let _ = engine.eval_ast_with_scope::<rhai::Dynamic>(&mut scope, edit_function).unwrap(); let _ = engine.eval_ast_with_scope::<rhai::Dynamic>(&mut scope, edit_function).unwrap();
data = RawMap::with_hasher_in(FxBuildHasher, doc_alloc); data = RawMap::with_hasher_in(FxBuildHasher, doc_alloc);
match scope.get_value::<Option<rhai::Map>>("doc").unwrap() { match scope.get_value::<rhai::Map>("doc") {
Some(map) => { Some(map) => {
for (key, value) in map { for (key, value) in map {
let mut vec = bumpalo::collections::Vec::new_in(doc_alloc); let mut vec = bumpalo::collections::Vec::new_in(doc_alloc);
@ -456,7 +456,7 @@ impl<'doc> Versions<'doc> {
let _ = engine.eval_ast_with_scope::<rhai::Dynamic>(&mut scope, edit_function).unwrap(); let _ = engine.eval_ast_with_scope::<rhai::Dynamic>(&mut scope, edit_function).unwrap();
data = RawMap::with_hasher_in(FxBuildHasher, doc_alloc); data = RawMap::with_hasher_in(FxBuildHasher, doc_alloc);
match scope.get_value::<Option<rhai::Map>>("doc").unwrap() { match scope.get_value::<rhai::Map>("doc") {
Some(map) => { Some(map) => {
for (key, value) in map { for (key, value) in map {
let mut vec = bumpalo::collections::Vec::new_in(doc_alloc); let mut vec = bumpalo::collections::Vec::new_in(doc_alloc);