Check that the writer implements fmt::Write first

This commit is contained in:
Chris Wong 2015-09-07 11:47:25 +12:00
parent 86c515e5c3
commit 44ca2aa82b

View file

@ -71,7 +71,10 @@ impl<'cx> Renderer<'cx> {
$loop_label: loop {
use ::std::fmt::Write;
match &mut $writer_expr {
$writer => { $stmts }
$writer => {
$writer as &mut ::std::fmt::Write;
$stmts
}
}
break $loop_label;
}