Skip to content

Commit 9dd61dd

Browse files
author
daniel.eades
committed
use 'assert' macro (clippy::manual_assert)
1 parent 171e859 commit 9dd61dd

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

graphql_client_cli/src/generate.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -138,12 +138,11 @@ fn format(code: &str) -> CliResult<String> {
138138

139139
let output = child.wait_with_output()?;
140140

141-
if !output.status.success() {
142-
panic!(
143-
"rustfmt error\n\n{}",
144-
String::from_utf8_lossy(&output.stderr)
145-
);
146-
}
141+
assert!(
142+
output.status.success(),
143+
"rustfmt error\n\n{}",
144+
String::from_utf8_lossy(&output.stderr)
145+
);
147146

148147
Ok(String::from_utf8(output.stdout)?)
149148
}

0 commit comments

Comments
 (0)