@@ -222,8 +222,7 @@ mod napi_binding {
222222 }
223223
224224 impl BindingCell < CodeGenerationResults > {
225- pub fn new ( code_generation_results : CodeGenerationResults ) -> Self {
226- let boxed = Box :: new ( code_generation_results) ;
225+ pub fn new ( boxed : Box < CodeGenerationResults > ) -> Self {
227226 let ptr = boxed. as_ref ( ) as * const CodeGenerationResults as * mut CodeGenerationResults ;
228227 let heap = Arc :: new ( Heap {
229228 variant : HeapVariant :: CodeGenerationResults ( boxed) ,
@@ -233,15 +232,14 @@ mod napi_binding {
233232 }
234233 }
235234
236- impl From < CodeGenerationResults > for BindingCell < CodeGenerationResults > {
237- fn from ( code_generation_results : CodeGenerationResults ) -> Self {
235+ impl From < Box < CodeGenerationResults > > for BindingCell < CodeGenerationResults > {
236+ fn from ( code_generation_results : Box < CodeGenerationResults > ) -> Self {
238237 Self :: new ( code_generation_results)
239238 }
240239 }
241240
242241 impl BindingCell < CodeGenerationResult > {
243- pub fn new ( code_generation_result : CodeGenerationResult ) -> Self {
244- let boxed = Box :: new ( code_generation_result) ;
242+ pub fn new ( boxed : Box < CodeGenerationResult > ) -> Self {
245243 let ptr = boxed. as_ref ( ) as * const CodeGenerationResult as * mut CodeGenerationResult ;
246244 let heap = Arc :: new ( Heap {
247245 variant : HeapVariant :: CodeGenerationResult ( boxed) ,
@@ -251,8 +249,8 @@ mod napi_binding {
251249 }
252250 }
253251
254- impl From < CodeGenerationResult > for BindingCell < CodeGenerationResult > {
255- fn from ( code_generation_result : CodeGenerationResult ) -> Self {
252+ impl From < Box < CodeGenerationResult > > for BindingCell < CodeGenerationResult > {
253+ fn from ( code_generation_result : Box < CodeGenerationResult > ) -> Self {
256254 Self :: new ( code_generation_result)
257255 }
258256 }
@@ -339,6 +337,18 @@ mod napi_binding {
339337 }
340338 }
341339
340+ impl Clone for BindingCell < CodeGenerationResults > {
341+ fn clone ( & self ) -> Self {
342+ Box :: new ( self . as_ref ( ) . clone ( ) ) . into ( )
343+ }
344+ }
345+
346+ impl Clone for BindingCell < CodeGenerationResult > {
347+ fn clone ( & self ) -> Self {
348+ Box :: new ( self . as_ref ( ) . clone ( ) ) . into ( )
349+ }
350+ }
351+
342352 impl < T : ?Sized + Hash > Hash for BindingCell < T > {
343353 fn hash < H : Hasher > ( & self , state : & mut H ) {
344354 self . as_ref ( ) . hash ( state) ;
0 commit comments