diff options
| author | Michael Sullivan <sully@msully.net> | 2012-07-13 22:57:48 -0700 |
|---|---|---|
| committer | Michael Sullivan <sully@msully.net> | 2012-07-14 01:03:43 -0700 |
| commit | 92743dc2a6a14d042d4b278e4a4dde5ca198c886 (patch) | |
| tree | 2626211c99906387257880f127f96fee66a0bb4e /src/rustdoc/unindent_pass.rs | |
| parent | 5c5065e8bdd1a7b28810fea4b940577ff17c112c (diff) | |
| download | rust-92743dc2a6a14d042d4b278e4a4dde5ca198c886.tar.gz rust-92743dc2a6a14d042d4b278e4a4dde5ca198c886.zip | |
Move the world over to using the new style string literals and types. Closes #2907.
Diffstat (limited to 'src/rustdoc/unindent_pass.rs')
| -rw-r--r-- | src/rustdoc/unindent_pass.rs | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/rustdoc/unindent_pass.rs b/src/rustdoc/unindent_pass.rs index 1df8d5b8f50..52d91a7994f 100644 --- a/src/rustdoc/unindent_pass.rs +++ b/src/rustdoc/unindent_pass.rs @@ -12,10 +12,10 @@ export mk_pass; fn mk_pass() -> pass { - text_pass::mk_pass("unindent", unindent) + text_pass::mk_pass(~"unindent", unindent) } -fn unindent(s: str) -> str { +fn unindent(s: ~str) -> ~str { let lines = str::lines_any(s); let mut saw_first_line = false; let mut saw_second_line = false; @@ -70,7 +70,7 @@ fn unindent(s: str) -> str { str::slice(line, min_indent, str::len(line)) } }; - str::connect(unindented, "\n") + str::connect(unindented, ~"\n") } else { s } @@ -78,25 +78,25 @@ fn unindent(s: str) -> str { #[test] fn should_unindent() { - let s = " line1\n line2"; + let s = ~" line1\n line2"; let r = unindent(s); - assert r == "line1\nline2"; + assert r == ~"line1\nline2"; } #[test] fn should_unindent_multiple_paragraphs() { - let s = " line1\n\n line2"; + let s = ~" line1\n\n line2"; let r = unindent(s); - assert r == "line1\n\nline2"; + assert r == ~"line1\n\nline2"; } #[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"; let r = unindent(s); - assert r == "line1\n\n line2"; + assert r == ~"line1\n\n line2"; } #[test] @@ -106,14 +106,14 @@ fn should_ignore_first_line_indent() { // // #[doc = "Start way over here // and continue here"] - let s = "line1\n line2"; + let s = ~"line1\n line2"; let r = unindent(s); - assert r == "line1\nline2"; + assert r == ~"line1\nline2"; } #[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"; let r = unindent(s); - assert r == "line1\n\n line2"; + assert r == ~"line1\n\n line2"; } |
