renvar 0.1.0

Library to deserialize environment variables in to Rust datatypes
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#[macro_export]
#[doc(hidden)]
macro_rules! forward_parsed_values {
    ($($typ:ident => $method:ident,)*) => {
        $(
            fn $method<V>(self, visitor: V) -> Result<V::Value>
                where V: de::Visitor<'de>
            {
                match self.0.parse::<$typ>() {
                    Ok(val) => val.into_deserializer().$method(visitor),
                    Err(e) => Err(de::Error::custom(format_args!("{} while parsing value '{}'", e, self.0)))
                }
            }
        )*
    }
}