diff --git a/bench/src/get_set_property.rs b/bench/src/get_set_property.rs index 1e5d3d01..9962cb78 100644 --- a/bench/src/get_set_property.rs +++ b/bench/src/get_set_property.rs @@ -44,16 +44,16 @@ pub fn register_js(exports: &mut JsObject, env: &Env) -> Result<()> { "TestClass", test_class_constructor, &[ - Property::new(&env, "miterNative")? + Property::new(env, "miterNative")? .with_getter(get_miter_native) .with_setter(set_miter_native), - Property::new(&env, "miter")? + Property::new(env, "miter")? .with_getter(get_miter) .with_setter(set_miter), - Property::new(&env, "lineJoinNative")? + Property::new(env, "lineJoinNative")? .with_getter(get_line_join_native) .with_setter(set_line_join_native), - Property::new(&env, "lineJoin")? + Property::new(env, "lineJoin")? .with_getter(get_line_join) .with_setter(set_line_join), ], diff --git a/build/src/windows.rs b/build/src/windows.rs index 362ccc53..39bc815f 100644 --- a/build/src/windows.rs +++ b/build/src/windows.rs @@ -44,7 +44,7 @@ pub fn setup() { // If file does not exist, download it. if metadata(&node_lib_file_path).is_err() { - let node_lib = copy_node_lib(&arch); + let node_lib = copy_node_lib(arch); write(&node_lib_file_path, &node_lib).expect(&format!( "Could not save file to {}", diff --git a/napi/src/js_values/ser.rs b/napi/src/js_values/ser.rs index 762d3be9..3bc30316 100644 --- a/napi/src/js_values/ser.rs +++ b/napi/src/js_values/ser.rs @@ -11,7 +11,7 @@ pub(crate) struct Ser<'env>(pub(crate) &'env Env); impl<'env> Ser<'env> { fn new(env: &'env Env) -> Self { - Self(&env) + Self(env) } } diff --git a/test_module/src/class.rs b/test_module/src/class.rs index 615d0123..78832129 100644 --- a/test_module/src/class.rs +++ b/test_module/src/class.rs @@ -8,8 +8,8 @@ struct NativeClass { #[js_function(1)] fn create_test_class(ctx: CallContext) -> Result { - let add_count_method = Property::new(&ctx.env, "addCount")?.with_method(add_count); - let add_native_count = Property::new(&ctx.env, "addNativeCount")?.with_method(add_native_count); + let add_count_method = Property::new(ctx.env, "addCount")?.with_method(add_count); + let add_native_count = Property::new(ctx.env, "addNativeCount")?.with_method(add_native_count); let properties = vec![add_count_method, add_native_count]; ctx .env @@ -47,8 +47,8 @@ fn add_native_count(ctx: CallContext) -> Result { #[js_function(1)] fn new_test_class(ctx: CallContext) -> Result { - let add_count_method = Property::new(&ctx.env, "addCount")?.with_method(add_count); - let add_native_count = Property::new(&ctx.env, "addNativeCount")?.with_method(add_native_count); + let add_count_method = Property::new(ctx.env, "addCount")?.with_method(add_count); + let add_native_count = Property::new(ctx.env, "addNativeCount")?.with_method(add_native_count); let properties = vec![add_count_method, add_native_count]; let test_class = ctx diff --git a/test_module/src/object.rs b/test_module/src/object.rs index a3a9f2c0..4728f072 100644 --- a/test_module/src/object.rs +++ b/test_module/src/object.rs @@ -135,8 +135,8 @@ fn test_delete_element(ctx: CallContext) -> Result { #[js_function(1)] fn test_define_properties(ctx: CallContext) -> Result { let mut obj = ctx.get::(0)?; - let add_method = Property::new(&ctx.env, "add")?.with_method(add); - let readonly_property = Property::new(&ctx.env, "ro")?.with_getter(readonly_getter); + let add_method = Property::new(ctx.env, "add")?.with_method(add); + let readonly_property = Property::new(ctx.env, "ro")?.with_getter(readonly_getter); let properties = vec![add_method, readonly_property]; obj.define_properties(&properties)?; obj.set_named_property("count", ctx.env.create_int32(0)?)?;