Enhance an error message about a path
@@ -12,7 +12,9 @@ pub(crate) enum ParserType {
impl ParserType {
pub fn parse(value: AttrValue) -> Result<Self> {
- value.expect(r#""default", "split" or a path"#, |v| match v {
+ value.expect(
+ r#""default", "split", or a path for custom parsers"#,
+ |v| match v {
AttrValue::Path(p) => Ok(ParserType::Custom(p)),
AttrValue::Lit(syn::Lit::Str(ref l)) => match &*l.value() {
"default" => Ok(ParserType::Default),
@@ -20,7 +22,8 @@ impl ParserType {
_ => Err(v),
},
_ => Err(v),
- })
+ },
+ )
}
}
