From c8c9d7c5074730622ad16f0c4a59322ff425e003 Mon Sep 17 00:00:00 2001 From: Bauke Date: Mon, 9 Jan 2023 16:22:51 +0100 Subject: [PATCH] Use chars for constant patterns. --- source/main.rs | 2 +- source/video/filters.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/source/main.rs b/source/main.rs index ef22dcd..3d3c943 100644 --- a/source/main.rs +++ b/source/main.rs @@ -30,7 +30,7 @@ fn main() -> Result<()> { fn build_userstyles(build_dir: &Path) -> Result<()> { for target in userstyles::ALL_USERSTYLES { let style = userstyles::Userstyle::load(target)?; - let style_name = style.metadata.name.to_lowercase().replace(" ", "-"); + let style_name = style.metadata.name.to_lowercase().replace(' ', "-"); let style_dir = build_dir.join("userstyles"); fs::create_dir_all(&style_dir)?; diff --git a/source/video/filters.rs b/source/video/filters.rs index ba8297c..138f6cd 100644 --- a/source/video/filters.rs +++ b/source/video/filters.rs @@ -25,7 +25,7 @@ Turn a timestamp with format `mm:ss` into its total seconds. - `01:30` -> 90 seconds */ pub fn timestamp_to_seconds(timestamp: &str) -> askama::Result { - let mut split = timestamp.split(":"); + let mut split = timestamp.split(':'); let minutes = split.next().map(str::parse::).unwrap().unwrap(); let seconds = split.next().map(str::parse::).unwrap().unwrap(); Ok(minutes * 60 + seconds)