Browse Source

Fix clippy warnings for rustc 1.76 (#3668)

pull/3665/head
José Julián Espina 10 months ago committed by GitHub
parent
commit
4523eaf0dd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      core/ast/src/expression/call.rs
  2. 2
      core/ast/src/expression/operator/assign/mod.rs
  3. 6
      core/engine/src/builtins/array/mod.rs
  4. 2
      core/engine/src/builtins/boolean/mod.rs
  5. 2
      core/engine/src/builtins/error/mod.rs
  6. 8
      core/engine/src/builtins/function/mod.rs
  7. 2
      core/engine/src/builtins/math/mod.rs
  8. 2
      core/engine/src/builtins/regexp/mod.rs
  9. 2
      core/engine/src/builtins/set/ordered_set.rs
  10. 16
      core/engine/src/builtins/string/mod.rs
  11. 6
      core/engine/src/builtins/weak_set/mod.rs
  12. 2
      core/gc/src/pointers/ephemeron.rs

2
core/ast/src/expression/call.rs

@ -163,7 +163,7 @@ impl VisitWith for SuperCall {
} }
} }
/// The import() syntax, commonly called dynamic import, is a function-like expression that allows /// The `import()` syntax, commonly called dynamic import, is a function-like expression that allows
/// loading an ECMAScript module asynchronously and dynamically into a potentially non-module /// loading an ECMAScript module asynchronously and dynamically into a potentially non-module
/// environment. /// environment.
/// ///

2
core/ast/src/expression/operator/assign/mod.rs

@ -1,3 +1,5 @@
#![allow(clippy::doc_link_with_quotes)]
//! Assignment expression nodes, as defined by the [spec]. //! Assignment expression nodes, as defined by the [spec].
//! //!
//! An [assignment operator][mdn] assigns a value to its left operand based on the value of its right //! An [assignment operator][mdn] assigns a value to its left operand based on the value of its right

6
core/engine/src/builtins/array/mod.rs

@ -511,7 +511,7 @@ impl Array {
/// `Array.from(arrayLike)` /// `Array.from(arrayLike)`
/// ///
/// The Array.from() static method creates a new, /// The `Array.from()` static method creates a new,
/// shallow-copied Array instance from an array-like or iterable object. /// shallow-copied Array instance from an array-like or iterable object.
/// ///
/// More information: /// More information:
@ -723,7 +723,7 @@ impl Array {
///'Array.prototype.at(index)' ///'Array.prototype.at(index)'
/// ///
/// The at() method takes an integer value and returns the item at that /// The `at()` method takes an integer value and returns the item at that
/// index, allowing for positive and negative integers. Negative integers /// index, allowing for positive and negative integers. Negative integers
/// count back from the last item in the array. /// count back from the last item in the array.
/// ///
@ -2981,7 +2981,7 @@ impl Array {
/// `Array.prototype.copyWithin ( target, start [ , end ] )` /// `Array.prototype.copyWithin ( target, start [ , end ] )`
/// ///
/// The copyWithin() method shallow copies part of an array to another location /// The `copyWithin()` method shallow copies part of an array to another location
/// in the same array and returns it without modifying its length. /// in the same array and returns it without modifying its length.
/// ///
/// More information: /// More information:

2
core/engine/src/builtins/boolean/mod.rs

@ -113,7 +113,7 @@ impl Boolean {
Ok(JsValue::new(js_string!(boolean.to_string()))) Ok(JsValue::new(js_string!(boolean.to_string())))
} }
/// The valueOf() method returns the primitive value of a `Boolean` object. /// The `valueOf()` method returns the primitive value of a `Boolean` object.
/// ///
/// More information: /// More information:
/// - [ECMAScript reference][spec] /// - [ECMAScript reference][spec]

2
core/engine/src/builtins/error/mod.rs

@ -225,7 +225,7 @@ impl Error {
/// `Error.prototype.toString()` /// `Error.prototype.toString()`
/// ///
/// The toString() method returns a string representing the specified Error object. /// The `toString()` method returns a string representing the specified Error object.
/// ///
/// More information: /// More information:
/// - [MDN documentation][mdn] /// - [MDN documentation][mdn]

8
core/engine/src/builtins/function/mod.rs

@ -353,7 +353,7 @@ impl BuiltInConstructor for BuiltInFunctionObject {
/// `Function ( p1, p2, … , pn, body )` /// `Function ( p1, p2, … , pn, body )`
/// ///
/// The apply() method invokes self with the first argument as the `this` value /// The `apply()` method invokes self with the first argument as the `this` value
/// and the rest of the arguments provided as an array (or an array-like object). /// and the rest of the arguments provided as an array (or an array-like object).
/// ///
/// More information: /// More information:
@ -609,7 +609,7 @@ impl BuiltInFunctionObject {
/// `Function.prototype.apply ( thisArg, argArray )` /// `Function.prototype.apply ( thisArg, argArray )`
/// ///
/// The apply() method invokes self with the first argument as the `this` value /// The `apply()` method invokes self with the first argument as the `this` value
/// and the rest of the arguments provided as an array (or an array-like object). /// and the rest of the arguments provided as an array (or an array-like object).
/// ///
/// More information: /// More information:
@ -648,7 +648,7 @@ impl BuiltInFunctionObject {
/// `Function.prototype.bind ( thisArg, ...args )` /// `Function.prototype.bind ( thisArg, ...args )`
/// ///
/// The bind() method creates a new function that, when called, has its /// The `bind()` method creates a new function that, when called, has its
/// this keyword set to the provided value, with a given sequence of arguments /// this keyword set to the provided value, with a given sequence of arguments
/// preceding any provided when the new function is called. /// preceding any provided when the new function is called.
/// ///
@ -732,7 +732,7 @@ impl BuiltInFunctionObject {
/// `Function.prototype.call ( thisArg, ...args )` /// `Function.prototype.call ( thisArg, ...args )`
/// ///
/// The call() method calls a function with a given this value and arguments provided individually. /// The `call()` method calls a function with a given this value and arguments provided individually.
/// ///
/// More information: /// More information:
/// - [MDN documentation][mdn] /// - [MDN documentation][mdn]

2
core/engine/src/builtins/math/mod.rs

@ -407,7 +407,7 @@ impl Math {
.into()) .into())
} }
/// The Math.expm1() function returns e^x - 1, where x is the argument, and e the base of /// The `Math.expm1()` function returns e^x - 1, where x is the argument, and e the base of
/// the natural logarithms. The result is computed in a way that is accurate even when the /// the natural logarithms. The result is computed in a way that is accurate even when the
/// value of x is close 0 /// value of x is close 0
/// ///

2
core/engine/src/builtins/regexp/mod.rs

@ -780,7 +780,7 @@ impl RegExp {
/// `RegExp.prototype.exec( string )` /// `RegExp.prototype.exec( string )`
/// ///
/// The exec() method executes a search for a match in a specified string. /// The `exec()` method executes a search for a match in a specified string.
/// ///
/// Returns a result array, or `null`. /// Returns a result array, or `null`.
/// ///

2
core/engine/src/builtins/set/ordered_set.rs

@ -128,7 +128,7 @@ impl OrderedSet {
} }
/// Get a key-value pair by index /// Get a key-value pair by index
/// Valid indices are 0 <= index < self.len() /// Valid indices are 0 <= `index` < `self.len()`
/// Computes in O(1) time. /// Computes in O(1) time.
#[must_use] #[must_use]
pub fn get_index(&self, index: usize) -> Option<&JsValue> { pub fn get_index(&self, index: usize) -> Option<&JsValue> {

16
core/engine/src/builtins/string/mod.rs

@ -520,7 +520,7 @@ impl String {
/// `String.prototype.at ( index )` /// `String.prototype.at ( index )`
/// ///
/// This String object's at() method returns a String consisting of the single UTF-16 code unit located at the specified position. /// This String object's `at()` method returns a String consisting of the single UTF-16 code unit located at the specified position.
/// Returns undefined if the given index cannot be found. /// Returns undefined if the given index cannot be found.
/// ///
/// More information: /// More information:
@ -1086,7 +1086,7 @@ impl String {
/// `22.1.3.18 String.prototype.replaceAll ( searchValue, replaceValue )` /// `22.1.3.18 String.prototype.replaceAll ( searchValue, replaceValue )`
/// ///
/// The replaceAll() method returns a new string with all matches of a pattern replaced by a /// The `replaceAll()` method returns a new string with all matches of a pattern replaced by a
/// replacement. /// replacement.
/// ///
/// The pattern can be a string or a `RegExp`, and the replacement can be a string or a /// The pattern can be a string or a `RegExp`, and the replacement can be a string or a
@ -1610,7 +1610,7 @@ impl String {
Self::string_pad(this, max_length, fill_string, Placement::Start, context) Self::string_pad(this, max_length, fill_string, Placement::Start, context)
} }
/// String.prototype.trim() /// `String.prototype.trim()`
/// ///
/// The `trim()` method removes whitespace from both ends of a string. /// The `trim()` method removes whitespace from both ends of a string.
/// ///
@ -1654,7 +1654,7 @@ impl String {
Ok(js_string!(string.trim_start()).into()) Ok(js_string!(string.trim_start()).into())
} }
/// String.prototype.trimEnd() /// `String.prototype.trimEnd()`
/// ///
/// The `trimEnd()` method removes whitespace from the end of a string. /// The `trimEnd()` method removes whitespace from the end of a string.
/// ///
@ -1881,7 +1881,7 @@ impl String {
/// `String.prototype.split ( separator, limit )` /// `String.prototype.split ( separator, limit )`
/// ///
/// The split() method divides a String into an ordered list of substrings, puts these substrings into an array, and returns the array. /// The `split()` method divides a String into an ordered list of substrings, puts these substrings into an array, and returns the array.
/// The division is done by searching for a pattern; where the pattern is provided as the first parameter in the method's call. /// The division is done by searching for a pattern; where the pattern is provided as the first parameter in the method's call.
/// ///
/// More information: /// More information:
@ -1999,7 +1999,7 @@ impl String {
) )
} }
/// String.prototype.valueOf() /// `String.prototype.valueOf()`
/// ///
/// The `valueOf()` method returns the primitive value of a `String` object. /// The `valueOf()` method returns the primitive value of a `String` object.
/// ///
@ -2079,7 +2079,7 @@ impl String {
/// `String.prototype.normalize( [ form ] )` /// `String.prototype.normalize( [ form ] )`
/// ///
/// The normalize() method normalizes a string into a form specified in the Unicode® Standard Annex #15 /// The `normalize()` method normalizes a string into a form specified in the Unicode® Standard Annex #15
/// ///
/// More information: /// More information:
/// - [ECMAScript reference][spec] /// - [ECMAScript reference][spec]
@ -2160,7 +2160,7 @@ impl String {
/// `String.prototype.search( regexp )` /// `String.prototype.search( regexp )`
/// ///
/// The search() method executes a search for a match between a regular expression and this String object. /// The `search()` method executes a search for a match between a regular expression and this String object.
/// ///
/// More information: /// More information:
/// - [ECMAScript reference][spec] /// - [ECMAScript reference][spec]

6
core/engine/src/builtins/weak_set/mod.rs

@ -127,7 +127,7 @@ impl BuiltInConstructor for WeakSet {
impl WeakSet { impl WeakSet {
/// `WeakSet.prototype.add( value )` /// `WeakSet.prototype.add( value )`
/// ///
/// The add() method appends a new object to the end of a `WeakSet` object. /// The `add()` method appends a new object to the end of a `WeakSet` object.
/// ///
/// More information: /// More information:
/// - [ECMAScript reference][spec] /// - [ECMAScript reference][spec]
@ -176,7 +176,7 @@ impl WeakSet {
/// `WeakSet.prototype.delete( value )` /// `WeakSet.prototype.delete( value )`
/// ///
/// The delete() method removes the specified element from a `WeakSet` object. /// The `delete()` method removes the specified element from a `WeakSet` object.
/// ///
/// More information: /// More information:
/// - [ECMAScript reference][spec] /// - [ECMAScript reference][spec]
@ -215,7 +215,7 @@ impl WeakSet {
/// `WeakSet.prototype.has( value )` /// `WeakSet.prototype.has( value )`
/// ///
/// The has() method returns a boolean indicating whether an object exists in a `WeakSet` or not. /// The `has()` method returns a boolean indicating whether an object exists in a `WeakSet` or not.
/// ///
/// More information: /// More information:
/// - [ECMAScript reference][spec] /// - [ECMAScript reference][spec]

2
core/gc/src/pointers/ephemeron.rs

@ -1,3 +1,5 @@
#![allow(clippy::doc_link_with_quotes)]
use crate::{ use crate::{
finalizer_safe, finalizer_safe,
internals::EphemeronBox, internals::EphemeronBox,

Loading…
Cancel
Save