Skip to content

Commit 8ee9410

Browse files
committed
---
yaml --- r: 63310 b: refs/heads/snap-stage3 c: d361802 h: refs/heads/master v: v3
1 parent 16afec9 commit 8ee9410

File tree

3 files changed

+14
-17
lines changed

3 files changed

+14
-17
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 2d28d645422c1617be58c8ca7ad9a457264ca850
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: eadd83da8b9abc821b141195503836b2094a9ea3
4+
refs/heads/snap-stage3: d3618025400eb4cea067380bfad11948969b7bc2
55
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/src/librustdoc/markdown_pass.rs

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -402,19 +402,17 @@ fn write_fnlike(
402402
fn write_sig(ctxt: &Ctxt, sig: Option<~str>) {
403403
match sig {
404404
Some(sig) => {
405-
ctxt.w.put_line(code_block_indent(sig));
405+
ctxt.w.put_line(code_block(sig));
406406
ctxt.w.put_line(~"");
407407
}
408408
None => fail!("unimplemented")
409409
}
410410
}
411411

412-
fn code_block_indent(s: ~str) -> ~str {
413-
let mut indented = ~[];
414-
for str::each_line_any(s) |line| {
415-
indented.push(fmt!(" %s", line));
416-
}
417-
indented.connect("\n")
412+
fn code_block(s: ~str) -> ~str {
413+
fmt!("~~~ {.rust}
414+
%s
415+
~~~", s)
418416
}
419417

420418
fn write_const(
@@ -754,17 +752,17 @@ mod test {
754752
#[test]
755753
fn should_write_the_function_signature() {
756754
let markdown = render(~"#[doc = \"f\"] fn a() { }");
757-
assert!(markdown.contains("\n fn a()\n"));
755+
assert!(markdown.contains("\n~~~ {.rust}\nfn a()\n"));
758756
}
759757

760758
#[test]
761759
fn should_insert_blank_line_after_fn_signature() {
762760
let markdown = render(~"#[doc = \"f\"] fn a() { }");
763-
assert!(markdown.contains("fn a()\n\n"));
761+
assert!(markdown.contains("fn a()\n~~~\n\n"));
764762
}
765763

766764
#[test]
767-
fn should_correctly_indent_fn_signature() {
765+
fn should_correctly_bracket_fn_signature() {
768766
let doc = create_doc(~"fn a() { }");
769767
let doc = doc::Doc{
770768
pages: ~[
@@ -781,13 +779,13 @@ mod test {
781779
]
782780
};
783781
let markdown = write_markdown_str(doc);
784-
assert!(markdown.contains(" line 1\n line 2"));
782+
assert!(markdown.contains("~~~ {.rust}\nline 1\nline 2\n~~~"));
785783
}
786784

787785
#[test]
788786
fn should_leave_blank_line_between_fn_header_and_sig() {
789787
let markdown = render(~"fn a() { }");
790-
assert!(markdown.contains("Function `a`\n\n fn a()"));
788+
assert!(markdown.contains("Function `a`\n\n~~~ {.rust}\nfn a()"));
791789
}
792790

793791
#[test]
@@ -887,7 +885,7 @@ mod test {
887885
#[test]
888886
fn should_write_trait_method_signature() {
889887
let markdown = render(~"trait i { fn a(&self); }");
890-
assert!(markdown.contains("\n fn a(&self)"));
888+
assert!(markdown.contains("\n~~~ {.rust}\nfn a(&self)"));
891889
}
892890

893891
#[test]
@@ -927,7 +925,7 @@ mod test {
927925
fn should_write_impl_method_signature() {
928926
let markdown = render(
929927
~"impl int { fn a(&mut self) { } }");
930-
assert!(markdown.contains("\n fn a(&mut self)"));
928+
assert!(markdown.contains("~~~ {.rust}\nfn a(&mut self)"));
931929
}
932930

933931
#[test]
@@ -946,7 +944,7 @@ mod test {
946944
#[test]
947945
fn should_write_type_signature() {
948946
let markdown = render(~"type t = int;");
949-
assert!(markdown.contains("\n\n type t = int\n\n"));
947+
assert!(markdown.contains("\n\n~~~ {.rust}\ntype t = int\n~~~\n"));
950948
}
951949

952950
#[test]

branches/snap-stage3/src/libstd/path.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -947,7 +947,6 @@ pub mod windows {
947947
mod tests {
948948
use option::{None, Some};
949949
use path::{PosixPath, WindowsPath, windows};
950-
use str;
951950

952951
#[test]
953952
fn test_double_slash_collapsing() {

0 commit comments

Comments
 (0)