diff options
| author | Huon Wilson <dbau.pp+github@gmail.com> | 2013-06-14 01:39:06 +1000 | 
|---|---|---|
| committer | Huon Wilson <dbau.pp+github@gmail.com> | 2013-06-16 10:50:28 +1000 | 
| commit | 4b18fff2be74df9a2db5ee6ab418da322ad6ae18 (patch) | |
| tree | 80a7b5caf2c7b2d1f6dc455fb725f4138f008f57 /src/librustdoc/markdown_pass.rs | |
| parent | c989b79127c5062df0a64d8c383de93c82a3d9b7 (diff) | |
| download | rust-4b18fff2be74df9a2db5ee6ab418da322ad6ae18.tar.gz rust-4b18fff2be74df9a2db5ee6ab418da322ad6ae18.zip | |
std: convert str::{map,levdistance,subslice_offset} to methods.
The first two become map_chars and lev_distance. Also, remove a few allocations in rustdoc.
Diffstat (limited to 'src/librustdoc/markdown_pass.rs')
| -rw-r--r-- | src/librustdoc/markdown_pass.rs | 6 | 
1 files changed, 2 insertions, 4 deletions
| diff --git a/src/librustdoc/markdown_pass.rs b/src/librustdoc/markdown_pass.rs index 17db7c24a7c..2e020cd9e5a 100644 --- a/src/librustdoc/markdown_pass.rs +++ b/src/librustdoc/markdown_pass.rs @@ -22,6 +22,7 @@ use markdown_writer::WriterFactory; use pass::Pass; use sort_pass; +use core::iterator::IteratorUtil; use core::cell::Cell; use core::str; use core::vec; @@ -466,10 +467,7 @@ fn write_variant(ctxt: &Ctxt, doc: doc::VariantDoc) { } fn list_item_indent(item: &str) -> ~str { - let mut indented = ~[]; - for str::each_line_any(item) |line| { - indented.push(line); - } + let indented = item.any_line_iter().collect::<~[&str]>(); // separate markdown elements within `*` lists must be indented by four // spaces, or they will escape the list context. indenting everything | 
