|
|
@ -9,17 +9,18 @@ use sexp::{
|
|
|
|
Atom,
|
|
|
|
Atom,
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
fn get_atom_string<'a, T>(maybe_atom: T) -> Result<&'a String, Error>
|
|
|
|
fn get_atom_string<'a>(maybe_atom: &'a Sexp) -> Result<&'a String, Error>
|
|
|
|
where T: AsRef<Sexp> + 'a
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
match maybe_atom.as_ref() {
|
|
|
|
match &maybe_atom {
|
|
|
|
Sexp::Atom(Atom::S(string)) => Ok(string),
|
|
|
|
Sexp::Atom(Atom::S(string)) => Ok(string),
|
|
|
|
_ => Err(Error::InvalidSexp),
|
|
|
|
_ => Err(Error::InvalidSexp),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
fn new_job(to: &mut Config, cdr: &[Sexp]) -> Result<(), Error> {
|
|
|
|
fn new_job(to: &mut Config, cdr: &[Sexp]) -> Result<(), Error> {
|
|
|
|
to.job_dirs.push(PathBuf::from(get_atom_string(&cdr[0])?));
|
|
|
|
let what = &cdr[0];
|
|
|
|
|
|
|
|
let what = get_atom_string(what)?;
|
|
|
|
|
|
|
|
to.job_dirs.push(PathBuf::from(what));
|
|
|
|
|
|
|
|
|
|
|
|
Ok(())
|
|
|
|
Ok(())
|
|
|
|
}
|
|
|
|
}
|
|
|
|