Skip to content
This repository was archived by the owner on Dec 17, 2022. It is now read-only.

Commit c8e1b69

Browse files
committed
chore(release): 0.5.3
1 parent 03faae3 commit c8e1b69

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

Cargo.lock

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "dprint-plugin-rustfmt"
3-
version = "0.5.2"
3+
version = "0.5.3"
44
authors = ["David Sherret <[email protected]>"]
55
edition = "2021"
66

src/format.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,16 @@ pub fn format_text(file_text: &str, config: &Configuration) -> Result<String> {
99
let input = Input::Text(String::from(file_text));
1010
let mut session = Session::new(config.rustfmt_config.clone(), Some(&mut out));
1111
session.format(input)?;
12-
13-
if !session.has_no_errors() {
14-
bail!("Rustfmt had errors.");
15-
}
1612
}
1713

1814
let text = std::str::from_utf8(&out)?;
1915
// rustfmt adds this prefix, so just ignore it
2016
let text = text
2117
.trim_start_matches("<stdin>:\n\n")
2218
.trim_start_matches("stdin:\n\n");
19+
if text.trim().is_empty() && file_text.trim().len() > 0 {
20+
bail!("Rustfmt had errors.")
21+
}
2322
Ok(text.to_string())
2423
}
2524

0 commit comments

Comments
 (0)