Skip to content

Commit 4730fa1

Browse files
author
daniel.eades
committed
use 'assert' macro (clippy::manual_assert)
1 parent 4ffbd22 commit 4730fa1

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
@@ -125,12 +125,11 @@ fn format(code: &str) -> CliResult<String> {
125125

126126
let output = child.wait_with_output()?;
127127

128-
if !output.status.success() {
129-
panic!(
130-
"rustfmt error\n\n{}",
131-
String::from_utf8_lossy(&output.stderr)
132-
);
133-
}
128+
assert!(
129+
output.status.success(),
130+
"rustfmt error\n\n{}",
131+
String::from_utf8_lossy(&output.stderr)
132+
);
134133

135134
Ok(String::from_utf8(output.stdout)?)
136135
}

0 commit comments

Comments
 (0)