diff --git a/boa_engine/src/error/mod.rs b/boa_engine/src/error/mod.rs index 56903274e69..ab134bd6feb 100644 --- a/boa_engine/src/error/mod.rs +++ b/boa_engine/src/error/mod.rs @@ -375,8 +375,7 @@ pub struct JsNativeError { } impl JsNativeError { - /// Creates a new `JsNativeError` from its `kind`, `message` and (optionally) - /// its `cause`. + /// Creates a new `JsNativeError` from its `kind`, `message` and (optionally) its `cause`. fn new(kind: JsNativeErrorKind, message: Box, cause: Option>) -> Self { Self { kind, @@ -385,8 +384,8 @@ impl JsNativeError { } } - /// Creates a new `JsNativeError` of kind `AggregateError` from - /// a list of [`JsError`]s, with empty `message` and undefined `cause`. + /// Creates a new `JsNativeError` of kind `AggregateError` from a list of [`JsError`]s, with + /// empty `message` and undefined `cause`. /// /// # Examples /// @@ -407,8 +406,7 @@ impl JsNativeError { Self::new(JsNativeErrorKind::Aggregate(errors), Box::default(), None) } - /// Creates a new `JsNativeError` of kind `Error`, with empty `message` - /// and undefined `cause`. + /// Creates a new `JsNativeError` of kind `Error`, with empty `message` and undefined `cause`. /// /// # Examples /// @@ -422,8 +420,7 @@ impl JsNativeError { Self::new(JsNativeErrorKind::Error, Box::default(), None) } - /// Creates a new `JsNativeError` of kind `EvalError`, with empty `message` - /// and undefined `cause`. + /// Creates a new `JsNativeError` of kind `EvalError`, with empty `message` and undefined `cause`. /// /// # Examples /// @@ -437,8 +434,7 @@ impl JsNativeError { Self::new(JsNativeErrorKind::Eval, Box::default(), None) } - /// Creates a new `JsNativeError` of kind `RangeError`, with empty `message` - /// and undefined `cause`. + /// Creates a new `JsNativeError` of kind `RangeError`, with empty `message` and undefined `cause`. /// /// # Examples /// @@ -452,8 +448,7 @@ impl JsNativeError { Self::new(JsNativeErrorKind::Range, Box::default(), None) } - /// Creates a new `JsNativeError` of kind `ReferenceError`, with empty `message` - /// and undefined `cause`. + /// Creates a new `JsNativeError` of kind `ReferenceError`, with empty `message` and undefined `cause`. /// /// # Examples /// @@ -467,8 +462,7 @@ impl JsNativeError { Self::new(JsNativeErrorKind::Reference, Box::default(), None) } - /// Creates a new `JsNativeError` of kind `SyntaxError`, with empty `message` - /// and undefined `cause`. + /// Creates a new `JsNativeError` of kind `SyntaxError`, with empty `message` and undefined `cause`. /// /// # Examples /// @@ -482,8 +476,7 @@ impl JsNativeError { Self::new(JsNativeErrorKind::Syntax, Box::default(), None) } - /// Creates a new `JsNativeError` of kind `TypeError`, with empty `message` - /// and undefined `cause`. + /// Creates a new `JsNativeError` of kind `TypeError`, with empty `message` and undefined `cause`. /// /// # Examples /// @@ -497,8 +490,7 @@ impl JsNativeError { Self::new(JsNativeErrorKind::Type, Box::default(), None) } - /// Creates a new `JsNativeError` of kind `UriError`, with empty `message` - /// and undefined `cause`. + /// Creates a new `JsNativeError` of kind `UriError`, with empty `message` and undefined `cause`. /// /// # Examples /// @@ -590,8 +582,7 @@ impl JsNativeError { self.cause.as_deref() } - /// Converts this native error to its opaque representation as a - /// [`JsObject`]. + /// Converts this native error to its opaque representation as a [`JsObject`]. /// /// # Examples /// @@ -745,8 +736,8 @@ pub enum JsNativeErrorKind { /// [spec]: https://tc39.es/ecma262/#sec-native-error-types-used-in-this-standard-typeerror /// [mdn]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError Type, - /// An error thrown when the [`encodeURI()`][e_uri] and [`decodeURI()`][d_uri] - /// functions receive invalid parameters. + /// An error thrown when the [`encodeURI()`][e_uri] and [`decodeURI()`][d_uri] functions receive + /// invalid parameters. /// /// More information: /// - [ECMAScript reference][spec] diff --git a/boa_engine/src/string/mod.rs b/boa_engine/src/string/mod.rs index cafe3f5b091..b8843b7cd2b 100644 --- a/boa_engine/src/string/mod.rs +++ b/boa_engine/src/string/mod.rs @@ -55,7 +55,7 @@ use self::common::{COMMON_STRINGS, COMMON_STRINGS_CACHE, MAX_COMMON_STRING_LENGT /// /// /// You can create a `JsString` from a string literal, which completely skips the runtime -/// conversion from [`&str`] to [`&\[u16\]`]: +/// conversion from [`&str`] to [&\[u16\]][slice]: /// /// ``` /// # use boa_engine::js_string; @@ -255,7 +255,7 @@ impl TaggedJsString { } /// Enum representing either a reference to a heap allocated [`RawJsString`] or a static reference to -/// a [`\[u16\]`][std::slice] inside [`COMMON_STRINGS`]. +/// a [`\[u16\]`][slice] inside [`COMMON_STRINGS`]. enum JsStringPtrKind<'a> { // A string allocated on the heap. Heap(&'a mut RawJsString), @@ -265,8 +265,8 @@ enum JsStringPtrKind<'a> { /// A UTF-16–encoded, reference counted, immutable string. /// -/// This is pretty similar to a [Rc][std::rc::Rc]\<[\[u16\]][std::slice]\>, but without -/// the length metadata associated with the [`Rc`][std::rc::Rc] fat pointer. Instead, the length of +/// This is pretty similar to a [Rc][std::rc::Rc]\<[\[u16\]][slice]\>, but without +/// the length metadata associated with the `Rc` fat pointer. Instead, the length of /// every string is stored on the heap, along with its reference counter and its data. /// /// We define some commonly used string constants in an interner. For these strings, we don't allocate @@ -274,8 +274,8 @@ enum JsStringPtrKind<'a> { /// /// # Deref /// -/// [`JsString`] implements [Deref], inheriting all of -/// [`\[u16\]`][std::slice]'s methods. +/// [`JsString`] implements [Deref], inheriting all of +/// \[u16\]'s methods. #[derive(Finalize)] pub struct JsString { ptr: TaggedJsString, @@ -287,7 +287,7 @@ unsafe impl Trace for JsString { } impl JsString { - /// Obtains the underlying [`&[u16]`][std::slice] slice of a [`JsString`] + /// Obtains the underlying [`&[u16]`][slice] slice of a [`JsString`] pub fn as_slice(&self) -> &[u16] { self } @@ -874,8 +874,7 @@ impl Utf16Trim for [u16] { } } -/// Utility trait that adds a `UTF-16` escaped representation to every -/// [`[u16]`][std::slice]. +/// Utility trait that adds a `UTF-16` escaped representation to every [`[u16]`][slice]. pub(crate) trait ToStringEscaped { /// Decodes `self` as an `UTF-16` encoded string, escaping any unpaired surrogates by its /// codepoint value.