Skip to content

Commit 13b128d

Browse files
committed
chore: fix linter errors
1 parent a5fb66f commit 13b128d

File tree

2 files changed

+7
-15
lines changed

2 files changed

+7
-15
lines changed

nova_vm/src/ecmascript/abstract_operations/type_conversion.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -464,9 +464,8 @@ pub(crate) fn to_integer_or_infinity_f64(number: f64) -> f64 {
464464
} else {
465465
// 5. Let integer be floor(abs(ℝ(number))).
466466
// 6. If number < +0𝔽, set integer to -integer.
467-
let integer = number.trunc();
468467
// 7. Return integer.
469-
integer
468+
number.trunc()
470469
}
471470
}
472471

nova_vm/src/ecmascript/builtins/date/data.rs

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use std::time::SystemTime;
66

77
use crate::{
88
SmallInteger,
9-
ecmascript::types::{IntoValue, Number, OrdinaryObject, Value},
9+
ecmascript::types::{IntoValue, OrdinaryObject, Value},
1010
heap::{CompactionLists, HeapMarkAndSweep, WorkQueues},
1111
};
1212

@@ -34,7 +34,7 @@ impl DateValue {
3434
if self.0 == i64::MAX {
3535
None
3636
} else {
37-
Some(self.0 as i64)
37+
Some(self.0)
3838
}
3939
}
4040

@@ -71,24 +71,17 @@ pub(crate) fn time_clip(time: f64) -> DateValue {
7171
DateValue(time.trunc() as i64)
7272
}
7373

74-
impl<'a> Into<Number<'a>> for DateValue {
75-
fn into(self) -> Number<'a> {
74+
impl<'a> IntoValue<'a> for DateValue {
75+
fn into_value(self) -> Value<'a> {
7676
if let Some(value) = self.get_f64() {
7777
// SAFETY: `value` is guaranteed to be in the range of `SmallInteger`.
78-
Number::Integer(SmallInteger::try_from(value).unwrap())
78+
Value::Integer(SmallInteger::try_from(value).unwrap())
7979
} else {
80-
Number::nan()
80+
Value::nan()
8181
}
8282
}
8383
}
8484

85-
impl<'a> IntoValue<'a> for DateValue {
86-
fn into_value(self) -> Value<'a> {
87-
let num: Number<'a> = self.into();
88-
num.into_value()
89-
}
90-
}
91-
9285
#[derive(Debug, Clone, Copy)]
9386
pub struct DateHeapData {
9487
pub(crate) object_index: Option<OrdinaryObject<'static>>,

0 commit comments

Comments
 (0)