mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Fixed some clippy warnings in components (#32107)
* Fixed some clippy warnings in components * Updated handling of NaN values in comparison * Updated formatting using ./mach fmt
This commit is contained in:
parent
f70413baba
commit
007a72fe4d
9 changed files with 20 additions and 29 deletions
|
@ -128,14 +128,11 @@ impl MediaFragmentParser {
|
|||
fn parse_utc_timestamp(&self, input: &str) -> Result<(Option<f64>, Option<f64>), ()> {
|
||||
if input.ends_with('-') || input.starts_with(',') || !input.contains('-') {
|
||||
let sec = parse_hms(
|
||||
NaiveDateTime::parse_from_str(
|
||||
&input.replace('-', "").replace(',', ""),
|
||||
"%Y%m%dT%H%M%S%.fZ",
|
||||
)
|
||||
.map_err(|_| ())?
|
||||
.time()
|
||||
.to_string()
|
||||
.as_ref(),
|
||||
NaiveDateTime::parse_from_str(&input.replace(['-', ','], ""), "%Y%m%dT%H%M%S%.fZ")
|
||||
.map_err(|_| ())?
|
||||
.time()
|
||||
.to_string()
|
||||
.as_ref(),
|
||||
)?;
|
||||
if input.starts_with(',') {
|
||||
Ok((Some(0.), Some(sec)))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue