Skip to content

Commit ce92446

Browse files
Fix unnecessary clone in web module's render_html
Co-authored-by: Tcode-Motion <188012755+Tcode-Motion@users.noreply.github.com>
1 parent 4c273b1 commit ce92446

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎stdlib/src/web.rs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -576,12 +576,12 @@ impl StdlibRegistry {
576576
arity: 0,
577577
callback: |ctx, _args| {
578578
let env = ctx.global_env.borrow();
579-
let blocks = match env.lookup("_dsl_blocks") {
580-
Ok(RuntimeValue::List { items, .. }) => items.borrow().clone(),
579+
let items = match env.lookup("_dsl_blocks") {
580+
Ok(RuntimeValue::List { items, .. }) => items,
581581
_ => return Ok(RuntimeValue::Str(String::new())),
582582
};
583583
let mut html = String::new();
584-
for block in &blocks {
584+
for block in &*items.borrow() {
585585
html.push_str(&dsl_to_html(block));
586586
}
587587
Ok(RuntimeValue::Str(html))

0 commit comments

Comments
 (0)