Commit c9385355 authored by Éloïs's avatar Éloïs

[fix] unencapsulated PestError

parent 6bcecdc8
......@@ -145,13 +145,11 @@ pub fn parse_doc_into_json(doc: &str, doc_type: DocumentType) -> String {
},
},
},
Err(parse_error) => {
if let TextDocumentParseError::UnknownType = parse_error {
"Invalid document. Specify the expected document type for more information."
.to_owned()
} else {
format!("{:?}", parse_error)
}
Err(parse_error) => match parse_error {
TextDocumentParseError::UnknownType => "Invalid document. Specify the expected document type for more information.".to_owned(),
TextDocumentParseError::PestError(pest_error) => format!("{}", pest_error),
_ => format!("{:?}", parse_error),
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment