aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/mediafragmentparser.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/dom/mediafragmentparser.rs')
-rw-r--r--components/script/dom/mediafragmentparser.rs13
1 files changed, 5 insertions, 8 deletions
diff --git a/components/script/dom/mediafragmentparser.rs b/components/script/dom/mediafragmentparser.rs
index a41951c1a4f..e8fb9b2c18a 100644
--- a/components/script/dom/mediafragmentparser.rs
+++ b/components/script/dom/mediafragmentparser.rs
@@ -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)))