Skip to content

Commit d4b21e7

Browse files
Fix recursive implementation of From<Number> for f64 (#2695)
The current code, I assume, attempted to hand over such implementation to that of `From<&Number> for f64`, but not only did it use the ambiguous `.` dot method syntax, it also forgot to take a reference to `n`, resulting `<Number as Into<f64>>::into` being called, whose implementation comes from the blanket `From -> Into` impl, effectively resulting in a recursive definition.
1 parent dc9141e commit d4b21e7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

crates/js-sys/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2447,7 +2447,7 @@ impl From<&Number> for f64 {
24472447
impl From<Number> for f64 {
24482448
#[inline]
24492449
fn from(n: Number) -> f64 {
2450-
n.into()
2450+
<f64 as From<&'_ Number>>::from(&n)
24512451
}
24522452
}
24532453

0 commit comments

Comments
 (0)