mirror of
https://github.com/encounter/rust-sdl2.git
synced 2026-07-10 21:18:41 -07:00
Consume result in wf! macro, considering write errors to be fatal.
This commit is contained in:
@@ -94,9 +94,14 @@ pub fn generate_branchified_method(
|
||||
macro_rules! wf(($($x:tt)*) => ({
|
||||
let indentstr = " ".repeat(indent * 4);
|
||||
let s = format!($($x)*);
|
||||
writer.write(indentstr.as_bytes());
|
||||
writer.write(s.as_bytes());
|
||||
writer.write(bytes!("\n"));
|
||||
let result = writer.write(indentstr.as_bytes())
|
||||
.and(writer.write(s.as_bytes()))
|
||||
.and(writer.write(bytes!("\n")));
|
||||
|
||||
match result {
|
||||
Ok(_) => {},
|
||||
Err(e) => fail!("write error: {:s}", e.desc),
|
||||
}
|
||||
}))
|
||||
|
||||
fn r(writer: &mut BufferedWriter<File>, branch: &ParseBranch, prefix: &str, indent: uint, read_call: &str,
|
||||
|
||||
Reference in New Issue
Block a user