diff options
| author | Aaron Turon <aturon@mozilla.com> | 2014-12-30 10:51:18 -0800 |
|---|---|---|
| committer | Aaron Turon <aturon@mozilla.com> | 2014-12-30 17:06:08 -0800 |
| commit | 6abfac083feafc73e5d736177755cce3bfb7153f (patch) | |
| tree | d5502fab0dd68ea96057616eb20d90a2c9050218 /src/libsyntax/print/pp.rs | |
| parent | 6e1879eaf1cb5e727eb134a3e27018f7535852eb (diff) | |
| download | rust-6abfac083feafc73e5d736177755cce3bfb7153f.tar.gz rust-6abfac083feafc73e5d736177755cce3bfb7153f.zip | |
Fallout from stabilization
Diffstat (limited to 'src/libsyntax/print/pp.rs')
| -rw-r--r-- | src/libsyntax/print/pp.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/libsyntax/print/pp.rs b/src/libsyntax/print/pp.rs index ab0e0f9585c..a15f1ca354b 100644 --- a/src/libsyntax/print/pp.rs +++ b/src/libsyntax/print/pp.rs @@ -65,6 +65,7 @@ pub use self::Token::*; use std::io; use std::string; +use std::iter::repeat; #[deriving(Clone, Copy, PartialEq)] pub enum Breaks { @@ -166,9 +167,9 @@ pub fn mk_printer(out: Box<io::Writer+'static>, linewidth: uint) -> Printer { // fall behind. let n: uint = 3 * linewidth; debug!("mk_printer {}", linewidth); - let token: Vec<Token> = Vec::from_elem(n, Eof); - let size: Vec<int> = Vec::from_elem(n, 0i); - let scan_stack: Vec<uint> = Vec::from_elem(n, 0u); + let token: Vec<Token> = repeat(Eof).take(n).collect(); + let size: Vec<int> = repeat(0i).take(n).collect(); + let scan_stack: Vec<uint> = repeat(0u).take(n).collect(); Printer { out: out, buf_len: n, |
