fcla 0.1.0

Command line argument parsing
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use crate::internal::*;

impl FromArg for String {
    type Parent = std::ffi::OsString;
    type Error = ();

    fn from_arg(arg: Self::Parent) -> Result<Self, Self::Error> {
        arg.into_string().map_err(|_| ())
    }

    fn box_error((): Self::Error) -> Box<dyn Error + Send + Sync> {
        Box::new(TypeError("string"))
    }
}