Use chars for constant patterns.
This commit is contained in:
parent
78187bbe07
commit
c8c9d7c507
|
@ -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)?;
|
||||
|
|
|
@ -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<i32> {
|
||||
let mut split = timestamp.split(":");
|
||||
let mut split = timestamp.split(':');
|
||||
let minutes = split.next().map(str::parse::<i32>).unwrap().unwrap();
|
||||
let seconds = split.next().map(str::parse::<i32>).unwrap().unwrap();
|
||||
Ok(minutes * 60 + seconds)
|
||||
|
|
Loading…
Reference in New Issue