From 57e91f810c22640ddf05f4abd0db4c754401e1f7 Mon Sep 17 00:00:00 2001 From: overlookmotel Date: Wed, 18 Dec 2024 00:31:08 +0000 Subject: [PATCH] refactor(transformer/class-properties): remove `move_expression`s --- .../src/es2022/class_properties/prop_decl.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/crates/oxc_transformer/src/es2022/class_properties/prop_decl.rs b/crates/oxc_transformer/src/es2022/class_properties/prop_decl.rs index 1e98aeaa2c1a3f..6c8049b2213bd9 100644 --- a/crates/oxc_transformer/src/es2022/class_properties/prop_decl.rs +++ b/crates/oxc_transformer/src/es2022/class_properties/prop_decl.rs @@ -24,10 +24,10 @@ impl<'a, 'ctx> ClassProperties<'a, 'ctx> { ctx: &mut TraverseCtx<'a>, ) { // Get value - let value = match &mut prop.value { - Some(value) => { - self.transform_instance_initializer(value, ctx); - ctx.ast.move_expression(value) + let value = match prop.value.take() { + Some(mut value) => { + self.transform_instance_initializer(&mut value, ctx); + value } None => ctx.ast.void_0(SPAN), }; @@ -90,10 +90,10 @@ impl<'a, 'ctx> ClassProperties<'a, 'ctx> { ) { // Get value, and transform it to replace `this` with reference to class name, // and transform class fields (`object.#prop`) - let value = match &mut prop.value { - Some(value) => { - self.transform_static_initializer(value, ctx); - ctx.ast.move_expression(value) + let value = match prop.value.take() { + Some(mut value) => { + self.transform_static_initializer(&mut value, ctx); + value } None => ctx.ast.void_0(SPAN), };