From 641f0c48d351f6e5f9433130a531ae32676a23b0 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Fri, 19 Aug 2016 16:31:39 -0400 Subject: [PATCH] Remove unneeded cast --- syntex/src/lib.rs | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/syntex/src/lib.rs b/syntex/src/lib.rs index cfcd61f2..6f7352fe 100644 --- a/syntex/src/lib.rs +++ b/syntex/src/lib.rs @@ -2,7 +2,7 @@ extern crate syntex_syntax; extern crate syntex_errors as errors; use std::fs::File; -use std::io::{self, Write}; +use std::io::Write; use std::path::Path; use syntex_syntax::ast; @@ -240,20 +240,15 @@ impl Registry { let mut out = Vec::new(); let annotation = pprust::NoAnn; - { - let out: &mut io::Write = &mut out; - - try!(pprust::print_crate( - sess.codemap(), - &sess.span_diagnostic, - &krate, - src_name, - &mut rdr, - Box::new(out), - &annotation, - false) - ); - } + try!(pprust::print_crate( + sess.codemap(), + &sess.span_diagnostic, + &krate, + src_name, + &mut rdr, + Box::new(&mut out), + &annotation, + false)); Ok(out) }