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:
komuhangi 2024-04-19 11:48:01 +03:00 committed by GitHub
parent f70413baba
commit 007a72fe4d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 20 additions and 29 deletions

View file

@ -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)))