lyrics-next 0.2.1

在终端下为 mpd/mpris 提供歌词.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use std::path::Path;

pub fn normalize_text(s: &str) -> String {
    s.to_lowercase()
        .replace([' ', '_', '-', '(', ')', '', ''], "")
        .trim()
        .to_string()
}

pub fn ensure_parent_dir(path: &Path) {
    if let Some(parent) = path.parent()
        && !parent.exists()
    {
        std::fs::create_dir_all(parent).ok();
    }
}