The unwrap call unwrapping toml::from_str's output in line 105 of /src/lib.rs (currently in master 7115b65c0b871494358cc4890304623cb64dfe84 and 0.3.1 95b1aac1e236ca32f19221709da4e29177308039) does that:
Will it be reasonable to create an enum ConfyError { BadTomlData } so I could return it in the load function at the point of toml::from_str's failure?
It would change load's type signature into a more general one or a totally different one if we return both IoErrors and ConfyError as Error trait values, I am not sure, so it might not be a good idea.
The
unwrap
call unwrappingtoml::from_str
's output in line 105 of/src/lib.rs
(currently in master 7115b65c0b871494358cc4890304623cb64dfe84 and 0.3.1 95b1aac1e236ca32f19221709da4e29177308039) does that:Ok(mut cfg) => Ok(toml::from_str(&cfg.get_string().unwrap()).unwrap()),
Will it be reasonable to create an
enum ConfyError { BadTomlData }
so I could return it in the load function at the point oftoml::from_str
's failure?It would change load's type signature into a more general one or a totally different one if we return both
IoError
s andConfyError
asError
trait values, I am not sure, so it might not be a good idea.