Skip to content

Commit 3345d25

Browse files
committed
test(transformer/styled-components): fix memory leak
1 parent 7b1f4a5 commit 3345d25

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

crates/oxc_transformer/src/plugins/styled_components.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1256,8 +1256,8 @@ mod tests {
12561256

12571257
#[test]
12581258
fn returns_indices_of_removed_placeholders() {
1259-
let allocator = Box::leak(Box::new(Allocator::default()));
1260-
let ast = AstBuilder::new(allocator);
1259+
let allocator = Allocator::default();
1260+
let ast = AstBuilder::new(&allocator);
12611261

12621262
// Create raw values that will generate placeholders
12631263
let css = "this is some\ninput with __PLACEHOLDER_0__ and // ignored __PLACEHOLDER_1__";

0 commit comments

Comments
 (0)