kplayer-rust-wrap 1.5.8

libkplayer plugin wrap for rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
pub fn args_vec_to_map(
    custom_args: Vec<String>,
) -> std::result::Result<std::collections::HashMap<String, String>, &'static str> {
    let mut args = std::collections::HashMap::new();
    for str in custom_args {
        let sp: Vec<&str> = str.split('=').collect();
        if sp.len() < 2 {
            return Err("args format error");
        }
        args.insert(String::from(sp[0]), String::from(sp[1]));
    }

    Ok(args)
}