diff --git a/boa_engine/src/object/internal_methods/array.rs b/boa_engine/src/object/internal_methods/array.rs index 82ded2229e5..6e095174f51 100644 --- a/boa_engine/src/object/internal_methods/array.rs +++ b/boa_engine/src/object/internal_methods/array.rs @@ -32,15 +32,15 @@ pub(crate) fn array_exotic_define_own_property( context: &mut Context<'_>, ) -> JsResult { // 1. Assert: IsPropertyKey(P) is true. - match key { + match *key { // 2. If P is "length", then - &PropertyKey::String(ref s) if s == utf16!("length") => { + PropertyKey::String(ref s) if s == utf16!("length") => { // a. Return ? ArraySetLength(A, Desc). array_set_length(obj, desc, context) } // 3. Else if P is an array index, then - &PropertyKey::Index(index) if index < u32::MAX => { + PropertyKey::Index(index) if index < u32::MAX => { // a. Let oldLenDesc be OrdinaryGetOwnProperty(A, "length"). let old_len_desc = super::ordinary_get_own_property(obj, &utf16!("length").into(), context)? diff --git a/boa_engine/src/object/internal_methods/global.rs b/boa_engine/src/object/internal_methods/global.rs index 6ce99aedade..41be3c3d052 100644 --- a/boa_engine/src/object/internal_methods/global.rs +++ b/boa_engine/src/object/internal_methods/global.rs @@ -66,14 +66,14 @@ pub(crate) fn global_define_own_property( ) -> JsResult { let _timer = Profiler::global().start_event("Object::global_define_own_property", "object"); // 1. Let current be ? O.[[GetOwnProperty]](P). - let current = global_get_own_property(obj, &key, context)?; + let current = global_get_own_property(obj, key, context)?; // 2. Let extensible be ? IsExtensible(O). let extensible = obj.__is_extensible__(context)?; // 3. Return ValidateAndApplyPropertyDescriptor(O, P, extensible, Desc, current). Ok(validate_and_apply_property_descriptor( - &key, extensible, desc, current, context, + key, extensible, desc, current, context, )) } diff --git a/boa_engine/src/object/internal_methods/mod.rs b/boa_engine/src/object/internal_methods/mod.rs index c679d801b57..00279675f66 100644 --- a/boa_engine/src/object/internal_methods/mod.rs +++ b/boa_engine/src/object/internal_methods/mod.rs @@ -468,7 +468,7 @@ pub(crate) fn ordinary_define_own_property( ) -> JsResult { let _timer = Profiler::global().start_event("Object::ordinary_define_own_property", "object"); // 1. Let current be ? O.[[GetOwnProperty]](P). - let current = obj.__get_own_property__(&key, context)?; + let current = obj.__get_own_property__(key, context)?; // 2. Let extensible be ? IsExtensible(O). let extensible = obj.__is_extensible__(context)?; @@ -782,7 +782,7 @@ pub(crate) fn validate_and_apply_property_descriptor( if let Some((obj, key)) = obj_and_key { obj.borrow_mut().properties.insert( - &key, + key, // c. If IsGenericDescriptor(Desc) is true or IsDataDescriptor(Desc) is true, then if desc.is_generic_descriptor() || desc.is_data_descriptor() { // i. If O is not undefined, create an own data property named P of @@ -899,7 +899,7 @@ pub(crate) fn validate_and_apply_property_descriptor( // a. For each field of Desc that is present, set the corresponding attribute of the // property named P of object O to the value of the field. current.fill_with(&desc); - obj.borrow_mut().properties.insert(&key, current); + obj.borrow_mut().properties.insert(key, current); } // 10. Return true. diff --git a/boa_engine/src/object/internal_methods/proxy.rs b/boa_engine/src/object/internal_methods/proxy.rs index 8fbd308f97c..6874d8d5d9d 100644 --- a/boa_engine/src/object/internal_methods/proxy.rs +++ b/boa_engine/src/object/internal_methods/proxy.rs @@ -430,7 +430,7 @@ pub(crate) fn proxy_exotic_define_own_property( } // 10. Let targetDesc be ? target.[[GetOwnProperty]](P). - let target_desc = target.__get_own_property__(&key, context)?; + let target_desc = target.__get_own_property__(key, context)?; // 11. Let extensibleTarget be ? IsExtensible(target). let extensible_target = target.is_extensible(context)?; diff --git a/boa_engine/src/object/internal_methods/string.rs b/boa_engine/src/object/internal_methods/string.rs index 4f4f0c857a1..d0f316a2f6f 100644 --- a/boa_engine/src/object/internal_methods/string.rs +++ b/boa_engine/src/object/internal_methods/string.rs @@ -58,7 +58,7 @@ pub(crate) fn string_exotic_define_own_property( ) -> JsResult { // 1. Assert: IsPropertyKey(P) is true. // 2. Let stringDesc be ! StringGetOwnProperty(S, P). - let string_desc = string_get_own_property(obj, &key); + let string_desc = string_get_own_property(obj, key); // 3. If stringDesc is not undefined, then if let Some(string_desc) = string_desc { diff --git a/boa_engine/src/object/mod.rs b/boa_engine/src/object/mod.rs index 012fe654f91..3f583045378 100644 --- a/boa_engine/src/object/mod.rs +++ b/boa_engine/src/object/mod.rs @@ -83,10 +83,10 @@ pub(crate) trait JsObjectType: } /// Const `constructor`, usually set on prototypes as a key to point to their respective constructor object. -pub const CONSTRUCTOR: &'static [u16] = utf16!("constructor"); +pub const CONSTRUCTOR: &[u16] = utf16!("constructor"); /// Const `prototype`, usually set on constructors as a key to point to their respective prototype object. -pub const PROTOTYPE: &'static [u16] = utf16!("prototype"); +pub const PROTOTYPE: &[u16] = utf16!("prototype"); /// Common field names.