Skip to content

Commit

Permalink
Fix clippy warnings for rustc 1.76 (#3668)
Browse files Browse the repository at this point in the history
  • Loading branch information
jedel1043 authored Feb 9, 2024
1 parent f1e2270 commit 4523eaf
Show file tree
Hide file tree
Showing 12 changed files with 28 additions and 24 deletions.
2 changes: 1 addition & 1 deletion core/ast/src/expression/call.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
/// environment.
///
Expand Down
2 changes: 2 additions & 0 deletions core/ast/src/expression/operator/assign/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(clippy::doc_link_with_quotes)]

//! 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
Expand Down
6 changes: 3 additions & 3 deletions core/engine/src/builtins/array/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ impl Array {

/// `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.
///
/// More information:
Expand Down Expand Up @@ -723,7 +723,7 @@ impl Array {

///'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
/// count back from the last item in the array.
///
Expand Down Expand Up @@ -2981,7 +2981,7 @@ impl Array {

/// `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.
///
/// More information:
Expand Down
2 changes: 1 addition & 1 deletion core/engine/src/builtins/boolean/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ impl Boolean {
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:
/// - [ECMAScript reference][spec]
Expand Down
2 changes: 1 addition & 1 deletion core/engine/src/builtins/error/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ impl Error {

/// `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:
/// - [MDN documentation][mdn]
Expand Down
8 changes: 4 additions & 4 deletions core/engine/src/builtins/function/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ impl BuiltInConstructor for BuiltInFunctionObject {

/// `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).
///
/// More information:
Expand Down Expand Up @@ -609,7 +609,7 @@ impl BuiltInFunctionObject {

/// `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).
///
/// More information:
Expand Down Expand Up @@ -648,7 +648,7 @@ impl BuiltInFunctionObject {

/// `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
/// preceding any provided when the new function is called.
///
Expand Down Expand Up @@ -732,7 +732,7 @@ impl BuiltInFunctionObject {

/// `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:
/// - [MDN documentation][mdn]
Expand Down
2 changes: 1 addition & 1 deletion core/engine/src/builtins/math/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ impl Math {
.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
/// value of x is close 0
///
Expand Down
2 changes: 1 addition & 1 deletion core/engine/src/builtins/regexp/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,7 @@ impl RegExp {

/// `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`.
///
Expand Down
2 changes: 1 addition & 1 deletion core/engine/src/builtins/set/ordered_set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ impl OrderedSet {
}

/// 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.
#[must_use]
pub fn get_index(&self, index: usize) -> Option<&JsValue> {
Expand Down
16 changes: 8 additions & 8 deletions core/engine/src/builtins/string/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ impl String {

/// `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.
///
/// More information:
Expand Down Expand Up @@ -1086,7 +1086,7 @@ impl String {

/// `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.
///
/// The pattern can be a string or a `RegExp`, and the replacement can be a string or a
Expand Down Expand Up @@ -1610,7 +1610,7 @@ impl String {
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.
///
Expand Down Expand Up @@ -1654,7 +1654,7 @@ impl String {
Ok(js_string!(string.trim_start()).into())
}

/// String.prototype.trimEnd()
/// `String.prototype.trimEnd()`
///
/// The `trimEnd()` method removes whitespace from the end of a string.
///
Expand Down Expand Up @@ -1881,7 +1881,7 @@ impl String {

/// `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.
///
/// More information:
Expand Down Expand Up @@ -1999,7 +1999,7 @@ impl String {
)
}

/// String.prototype.valueOf()
/// `String.prototype.valueOf()`
///
/// The `valueOf()` method returns the primitive value of a `String` object.
///
Expand Down Expand Up @@ -2079,7 +2079,7 @@ impl String {

/// `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:
/// - [ECMAScript reference][spec]
Expand Down Expand Up @@ -2160,7 +2160,7 @@ impl String {

/// `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:
/// - [ECMAScript reference][spec]
Expand Down
6 changes: 3 additions & 3 deletions core/engine/src/builtins/weak_set/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ impl BuiltInConstructor for WeakSet {
impl WeakSet {
/// `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:
/// - [ECMAScript reference][spec]
Expand Down Expand Up @@ -176,7 +176,7 @@ impl WeakSet {

/// `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:
/// - [ECMAScript reference][spec]
Expand Down Expand Up @@ -215,7 +215,7 @@ impl WeakSet {

/// `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:
/// - [ECMAScript reference][spec]
Expand Down
2 changes: 2 additions & 0 deletions core/gc/src/pointers/ephemeron.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(clippy::doc_link_with_quotes)]

use crate::{
finalizer_safe,
internals::EphemeronBox,
Expand Down

0 comments on commit 4523eaf

Please sign in to comment.