diff options
| author | Richo Healey <richo@psych0tik.net> | 2014-04-15 18:17:48 -0700 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2014-04-18 17:25:34 -0700 |
| commit | 919889a1d688a6bbe2edac8705f048f06b1b455c (patch) | |
| tree | 322a69fa39bdaf37bbfffc84020acbd4c87871d0 /src/librustdoc/passes.rs | |
| parent | b75683cadf6c4c55360202cd6a0106be80532451 (diff) | |
| download | rust-919889a1d688a6bbe2edac8705f048f06b1b455c.tar.gz rust-919889a1d688a6bbe2edac8705f048f06b1b455c.zip | |
Replace all ~"" with "".to_owned()
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()); } } |
