diff --git a/crates/js-sys/src/lib.rs b/crates/js-sys/src/lib.rs index 2db0d4bc00c..140a3edab21 100644 --- a/crates/js-sys/src/lib.rs +++ b/crates/js-sys/src/lib.rs @@ -1027,6 +1027,7 @@ impl Default for BigInt { impl FromStr for BigInt { type Err = Infallible; + #[inline] fn from_str(s: &str) -> Result { Ok(BigInt::new(&s.into())) } @@ -1090,6 +1091,7 @@ impl Default for Boolean { impl Not for &Boolean { type Output = Boolean; + #[inline] fn not(self) -> Self::Output { (!JsValue::as_ref(self)).into() } @@ -2247,6 +2249,7 @@ impl Number { /// Applies the binary `**` JS operator on the two `Number`s. /// /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Exponentiation) + #[inline] pub fn pow(&self, rhs: &Self) -> Self { JsValue::as_ref(self) .pow(JsValue::as_ref(rhs)) @@ -2256,6 +2259,7 @@ impl Number { /// Applies the binary `>>>` JS operator on the two `Number`s. /// /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Unsigned_right_shift) + #[inline] pub fn unsigned_shr(&self, rhs: &Self) -> Self { Number::from(JsValue::as_ref(self).unsigned_shr(JsValue::as_ref(rhs))) } @@ -2323,6 +2327,7 @@ impl PartialEq for Number { impl Not for &Number { type Output = BigInt; + #[inline] fn not(self) -> Self::Output { JsValue::as_ref(self).bit_not().unchecked_into() } @@ -2342,6 +2347,7 @@ forward_js_binop!(impl Mul, mul for Number); forward_js_binop!(impl Rem, rem for Number); impl PartialOrd for Number { + #[inline] fn partial_cmp(&self, other: &Self) -> Option { if Number::is_nan(self) || Number::is_nan(other) { None @@ -2354,18 +2360,22 @@ impl PartialOrd for Number { } } + #[inline] fn lt(&self, other: &Self) -> bool { JsValue::as_ref(self).lt(JsValue::as_ref(other)) } + #[inline] fn le(&self, other: &Self) -> bool { JsValue::as_ref(self).le(JsValue::as_ref(other)) } + #[inline] fn ge(&self, other: &Self) -> bool { JsValue::as_ref(self).ge(JsValue::as_ref(other)) } + #[inline] fn gt(&self, other: &Self) -> bool { JsValue::as_ref(self).gt(JsValue::as_ref(other)) } @@ -2375,6 +2385,7 @@ impl FromStr for Number { type Err = Infallible; #[allow(deprecated)] + #[inline] fn from_str(s: &str) -> Result { Ok(Number::new_from_str(s)) }