report syn parse errors to the user

This commit is contained in:
Evan Almloff committed 2024-02-08 10:00:25 -06:00
1 parent 65d4f922b4
commit b88c66d8df
5 files changed
+29 -19

No files matched your search

-7
View File
@@ -240,10 +240,3 @@ pub(crate) fn write_ifmt(input: &IfmtInput, writable: &mut impl Write) -> std::f
let display = DisplayIfmt(input);
write!(writable, "{}", display)
}
/// Call rustfmt to format code, i32 as exitcode
pub fn rustfmt(input: &str) -> Option<String> {
let syntax_tree = syn::parse_file(input).ok()?;
let output = prettyplease::unparse(&syntax_tree);
Some(output)
}