Skip to content

Commit d5c7ac0

Browse files
committed
Make the bail macros a little more hygienic
I wrote similar macros for another (private) project of mine, but didn't consistently have this trait available at the site of use, so totally forgot that was a requirement. Fixing this up here so I can continue to use it as an example for myself.
1 parent 90c9dc9 commit d5c7ac0

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/bail.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
/// with exit code 1.
55
macro_rules! xt_bail {
66
($fmt:literal $(, $($args:tt)* )?) => {{
7+
use ::std::io::Write;
78
let _ = writeln!(
89
::std::io::stderr().lock(),
910
"xt error: {}",
@@ -17,6 +18,7 @@ macro_rules! xt_bail {
1718
/// then terminates the current process with exit code 1.
1819
macro_rules! xt_bail_path {
1920
($path:expr, $fmt:literal $(, $($args:tt)* )?) => {{
21+
use ::std::io::Write;
2022
let _ = writeln!(
2123
::std::io::stderr().lock(),
2224
"xt error in {}: {}",

0 commit comments

Comments
 (0)