diff options
Diffstat (limited to 'src/librustdoc/passes.rs')
| -rw-r--r-- | src/librustdoc/passes.rs | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/librustdoc/passes.rs b/src/librustdoc/passes.rs index 3f45b1a7e69..ed71dc27d9d 100644 --- a/src/librustdoc/passes.rs +++ b/src/librustdoc/passes.rs @@ -219,7 +219,7 @@ pub fn unindent_comments(krate: clean::Crate) -> plugins::PluginResult { for attr in i.attrs.iter() { match attr { &clean::NameValue(ref x, ref s) if "doc" == *x => avec.push( - clean::NameValue(~"doc", unindent(*s))), + clean::NameValue("doc".to_owned(), unindent(*s))), x => avec.push(x.clone()) } } @@ -252,7 +252,7 @@ pub fn collapse_docs(krate: clean::Crate) -> plugins::PluginResult { _ => true }).map(|x| x.clone()).collect(); if docstr.len() > 0 { - a.push(clean::NameValue(~"doc", docstr.into_owned())); + a.push(clean::NameValue("doc".to_owned(), docstr.into_owned())); } i.attrs = a; self.fold_item_recur(i) @@ -329,25 +329,25 @@ mod unindent_tests { #[test] fn should_unindent() { - let s = ~" line1\n line2"; + let s = " line1\n line2".to_owned(); let r = unindent(s); - assert_eq!(r, ~"line1\nline2"); + assert_eq!(r, "line1\nline2".to_owned()); } #[test] fn should_unindent_multiple_paragraphs() { - let s = ~" line1\n\n line2"; + let s = " line1\n\n line2".to_owned(); let r = unindent(s); - assert_eq!(r, ~"line1\n\nline2"); + assert_eq!(r, "line1\n\nline2".to_owned()); } #[test] fn should_leave_multiple_indent_levels() { // Line 2 is indented another level beyond the // base indentation and should be preserved - let s = ~" line1\n\n line2"; + let s = " line1\n\n line2".to_owned(); let r = unindent(s); - assert_eq!(r, ~"line1\n\n line2"); + assert_eq!(r, "line1\n\n line2".to_owned()); } #[test] @@ -357,15 +357,15 @@ mod unindent_tests { // // #[doc = "Start way over here // and continue here"] - let s = ~"line1\n line2"; + let s = "line1\n line2".to_owned(); let r = unindent(s); - assert_eq!(r, ~"line1\nline2"); + assert_eq!(r, "line1\nline2".to_owned()); } #[test] fn should_not_ignore_first_line_indent_in_a_single_line_para() { - let s = ~"line1\n\n line2"; + let s = "line1\n\n line2".to_owned(); let r = unindent(s); - assert_eq!(r, ~"line1\n\n line2"); + assert_eq!(r, "line1\n\n line2".to_owned()); } } |
