pub mod video; use std::path::Path; pub fn must_analyze(file: &str) -> String { match analyze(file) { Ok(result) => result, Err(msg) => msg, } } pub fn analyze(file: &str) -> Result { eprintln!("analyzing {}", file); Err(format!("not impl")) } pub fn must_clipify(file: &str) -> String { match clipify(file) { Ok(result) => result, Err(msg) => msg, } } pub fn clipify(file: &str) -> Result { eprintln!("clipifying {}", file); let files = video::clipify(&file.to_string())?; match files.iter().nth(0) { Some(file) => Ok(Path::new(file).parent().unwrap().to_str().unwrap().to_string()), None => Err(format!("no clips found from {}", file)), } }