Skip to content

Commit 3585c64

Browse files
committed
rustdoc: Change all code-blocks with a script
find src -name '*.rs' | xargs sed -i '' 's/~~~.*{\.rust}/```rust/g' find src -name '*.rs' | xargs sed -i '' 's/ ~~~$/ ```/g' find src -name '*.rs' | xargs sed -i '' 's/^~~~$/ ```/g'
1 parent db28c29 commit 3585c64

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+386
-386
lines changed

src/libextra/arc.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* In this example, a large vector of floats is shared between several tasks.
1818
* With simple pipes, without Arc, a copy would have to be made for each task.
1919
*
20-
* ~~~ {.rust}
20+
* ```rust
2121
* extern mod std;
2222
* use extra::arc;
2323
* let numbers=vec::from_fn(100, |ind| (ind as float)*rand::random());
@@ -34,7 +34,7 @@
3434
* // Work with the local numbers
3535
* }
3636
* }
37-
* ~~~
37+
* ```
3838
*/
3939

4040
#[allow(missing_doc)];
@@ -440,7 +440,7 @@ impl<T:Freeze + Send> RWArc<T> {
440440
*
441441
* # Example
442442
*
443-
* ~~~ {.rust}
443+
* ```rust
444444
* do arc.write_downgrade |mut write_token| {
445445
* do write_token.write_cond |state, condvar| {
446446
* ... exclusive access with mutable state ...
@@ -450,7 +450,7 @@ impl<T:Freeze + Send> RWArc<T> {
450450
* ... shared access with immutable state ...
451451
* }
452452
* }
453-
* ~~~
453+
* ```
454454
*/
455455
pub fn write_downgrade<U>(&self, blk: &fn(v: RWWriteMode<T>) -> U) -> U {
456456
unsafe {

src/libextra/base64.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,15 @@ impl<'self> ToBase64 for &'self [u8] {
6262
*
6363
* # Example
6464
*
65-
* ~~~ {.rust}
65+
* ```rust
6666
* extern mod extra;
6767
* use extra::base64::{ToBase64, standard};
6868
*
6969
* fn main () {
7070
* let str = [52,32].to_base64(standard);
7171
* printfln!("%s", str);
7272
* }
73-
* ~~~
73+
* ```
7474
*/
7575
fn to_base64(&self, config: Config) -> ~str {
7676
let bytes = match config.char_set {
@@ -170,7 +170,7 @@ impl<'self> FromBase64 for &'self str {
170170
*
171171
* This converts a string literal to base64 and back.
172172
*
173-
* ~~~ {.rust}
173+
* ```rust
174174
* extern mod extra;
175175
* use extra::base64::{ToBase64, FromBase64, standard};
176176
* use std::str;
@@ -183,7 +183,7 @@ impl<'self> FromBase64 for &'self str {
183183
* let result_str = str::from_utf8(bytes);
184184
* printfln!("%s", result_str);
185185
* }
186-
* ~~~
186+
* ```
187187
*/
188188
fn from_base64(&self) -> Result<~[u8], ~str> {
189189
let mut r = ~[];

src/libextra/flatpipes.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ ports and channels.
2525
2626
This example sends boxed integers across tasks using serialization.
2727
28-
~~~ {.rust}
28+
```rust
2929
let (port, chan) = serial::pipe_stream();
3030
3131
do task::spawn || {
@@ -37,7 +37,7 @@ do task::spawn || {
3737
for i in range(0, 10) {
3838
assert @i == port.recv()
3939
}
40-
~~~
40+
```
4141
4242
# Safety Note
4343

src/libextra/future.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@
1414
*
1515
* # Example
1616
*
17-
* ~~~ {.rust}
17+
* ```rust
1818
* # fn fib(n: uint) -> uint {42};
1919
* # fn make_a_sandwich() {};
2020
* let mut delayed_fib = extra::future::spawn (|| fib(5000) );
2121
* make_a_sandwich();
2222
* printfln!("fib(5000) = %?", delayed_fib.get())
23-
* ~~~
23+
* ```
2424
*/
2525

2626
#[allow(missing_doc)];

src/libextra/glob.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,18 +51,18 @@ pub struct GlobIterator {
5151
* Consider a directory `/media/pictures` containing only the files `kittens.jpg`,
5252
* `puppies.jpg` and `hamsters.gif`:
5353
*
54-
* ~~~ {.rust}
54+
* ```rust
5555
* for path in glob("/media/pictures/*.jpg") {
5656
* println(path.to_str());
5757
* }
58-
* ~~~
58+
* ```
5959
*
6060
* The above code will print:
6161
*
62-
* ~~~
62+
* ```
6363
* /media/pictures/kittens.jpg
6464
* /media/pictures/puppies.jpg
65-
* ~~~
65+
* ```
6666
*/
6767
pub fn glob(pattern: &str) -> GlobIterator {
6868
glob_with(pattern, MatchOptions::new())
@@ -270,11 +270,11 @@ impl Pattern {
270270
*
271271
* # Example
272272
*
273-
* ~~~ {.rust}
273+
* ```rust
274274
* assert!(Pattern::new("c?t").matches("cat"));
275275
* assert!(Pattern::new("k[!e]tteh").matches("kitteh"));
276276
* assert!(Pattern::new("d*g").matches("doog"));
277-
* ~~~
277+
* ```
278278
*/
279279
pub fn matches(&self, str: &str) -> bool {
280280
self.matches_with(str, MatchOptions::new())
@@ -492,13 +492,13 @@ impl MatchOptions {
492492
*
493493
* This function always returns this value:
494494
*
495-
* ~~~ {.rust}
495+
* ```rust
496496
* MatchOptions {
497497
* case_sensitive: true,
498498
* require_literal_separator: false.
499499
* require_literal_leading_dot: false
500500
* }
501-
* ~~~
501+
* ```
502502
*/
503503
pub fn new() -> MatchOptions {
504504
MatchOptions {

src/libextra/hex.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@ impl<'self> ToHex for &'self [u8] {
2727
*
2828
* # Example
2929
*
30-
* ~~~ {.rust}
30+
* ```rust
3131
* extern mod extra;
3232
* use extra::hex::ToHex;
3333
*
3434
* fn main () {
3535
* let str = [52,32].to_hex();
3636
* printfln!("%s", str);
3737
* }
38-
* ~~~
38+
* ```
3939
*/
4040
fn to_hex(&self) -> ~str {
4141
let mut v = vec::with_capacity(self.len() * 2);
@@ -70,7 +70,7 @@ impl<'self> FromHex for &'self str {
7070
*
7171
* This converts a string literal to hexadecimal and back.
7272
*
73-
* ~~~ {.rust}
73+
* ```rust
7474
* extern mod extra;
7575
* use extra::hex::{FromHex, ToHex};
7676
* use std::str;
@@ -83,7 +83,7 @@ impl<'self> FromHex for &'self str {
8383
* let result_str = str::from_utf8(bytes);
8484
* printfln!("%s", result_str);
8585
* }
86-
* ~~~
86+
* ```
8787
*/
8888
fn from_hex(&self) -> Result<~[u8], ~str> {
8989
// This may be an overestimate if there is any whitespace

src/libextra/sync.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,7 @@ impl RWLock {
578578
*
579579
* # Example
580580
*
581-
* ~~~ {.rust}
581+
* ```rust
582582
* do lock.write_downgrade |mut write_token| {
583583
* do write_token.write_cond |condvar| {
584584
* ... exclusive access ...
@@ -588,7 +588,7 @@ impl RWLock {
588588
* ... shared access ...
589589
* }
590590
* }
591-
* ~~~
591+
* ```
592592
*/
593593
pub fn write_downgrade<U>(&self, blk: &fn(v: RWLockWriteMode) -> U) -> U {
594594
// Implementation slightly different from the slicker 'write's above.

src/libextra/uuid.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ unlikely.
2828
2929
To create a new random (V4) UUID and print it out in hexadecimal form:
3030
31-
~~~ {.rust}
31+
```rust
3232
extern mod extra;
3333
use extra::uuid::Uuid;
3434
3535
fn main() {
3636
let uuid1 = Uuid::new_v4();
3737
println(uuid1.to_str());
3838
}
39-
~~~
39+
```
4040
4141
# Strings
4242

src/librustc/middle/typeck/infer/doc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,4 +240,4 @@ We make use of a trait-like impementation strategy to consolidate
240240
duplicated code between subtypes, GLB, and LUB computations. See the
241241
section on "Type Combining" below for details.
242242
243-
*/
243+
*/

src/librustpkg/testsuite/pass/src/fancy-lib/foo.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@
99
// except according to those terms.
1010

1111
pub fn do_nothing() {
12-
}
12+
}

src/librustpkg/testsuite/pass/src/install-paths/bench.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ fn g() {
1414
while(x < 1000) {
1515
x += 1;
1616
}
17-
}
17+
}

src/librustpkg/testsuite/pass/src/simple-lib/src/foo.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@
99
// except according to those terms.
1010

1111
pub fn do_nothing() {
12-
}
12+
}

0 commit comments

Comments
 (0)