mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
clippy: Fix a bunch of warnings in script
(#32680)
This is just a portion of the errors that are remaining to be fixed.
This commit is contained in:
parent
93fdb8263d
commit
26624a109f
27 changed files with 150 additions and 113 deletions
|
@ -2141,15 +2141,16 @@ impl HTMLInputElement {
|
|||
},
|
||||
InputType::DatetimeLocal => {
|
||||
// Is this supposed to know the locale's daylight-savings-time rules?
|
||||
value.parse_local_date_and_time_string().and_then(
|
||||
|((year, month, day), (hours, minutes, seconds))| {
|
||||
let hms_millis =
|
||||
(seconds + 60.0 * minutes as f64 + 3600.0 * hours as f64) * 1000.0;
|
||||
NaiveDate::from_ymd_opt(year, month, day)
|
||||
.and_then(|date| date.and_hms_opt(0, 0, 0))
|
||||
.map(|time| time.and_utc().timestamp_millis() as f64 + hms_millis)
|
||||
},
|
||||
)
|
||||
value.parse_local_date_and_time_string().and_then(|date| {
|
||||
let seconds = date.seconds as u32;
|
||||
let milliseconds = ((date.seconds - seconds as f64) * 1000.) as u32;
|
||||
Some(
|
||||
NaiveDate::from_ymd_opt(date.year, date.month, date.day)?
|
||||
.and_hms_milli_opt(date.hour, date.minute, seconds, milliseconds)?
|
||||
.and_utc()
|
||||
.timestamp_millis() as f64,
|
||||
)
|
||||
})
|
||||
},
|
||||
InputType::Number | InputType::Range => value.parse_floating_point_number(),
|
||||
// min/max/valueAsNumber/stepDown/stepUp do not apply to
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue