Skip to content

Commit 8e64b61

Browse files
committed
move rustdoc comments so that they attach to the functions rather than the impl blocks.
1 parent 27a0269 commit 8e64b61

File tree

1 file changed

+79
-79
lines changed

1 file changed

+79
-79
lines changed

src/libstd/base64.rs

+79-79
Original file line numberDiff line numberDiff line change
@@ -26,22 +26,22 @@ static CHARS: [char, ..64] = [
2626
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '/'
2727
];
2828

29-
/**
30-
* Turn a vector of `u8` bytes into a string representing them in base64.
31-
*
32-
* *Example*:
33-
*
34-
* ~~~~
35-
* extern mod std;
36-
* use std::base64::ToBase64;
37-
*
38-
* fn main () {
39-
* let str = [52,32].to_base64();
40-
* println(fmt!("%s", str));
41-
* }
42-
* ~~~~
43-
*/
4429
impl<'self> ToBase64 for &'self [u8] {
30+
/**
31+
* Turn a vector of `u8` bytes into a string representing them in base64.
32+
*
33+
* *Example*:
34+
*
35+
* ~~~~
36+
* extern mod std;
37+
* use std::base64::ToBase64;
38+
*
39+
* fn main () {
40+
* let str = [52,32].to_base64();
41+
* println(fmt!("%s", str));
42+
* }
43+
* ~~~~
44+
*/
4545
fn to_base64(&self) -> ~str {
4646
let mut s = ~"";
4747
unsafe {
@@ -90,24 +90,24 @@ impl<'self> ToBase64 for &'self [u8] {
9090
}
9191
}
9292
93-
/**
94-
* Convert any string (literal, `@`, `&`, `~`) to base64 encoding.
95-
*
96-
*
97-
* *Example*:
98-
*
99-
* ~~~~
100-
* extern mod std;
101-
* use std::base64::ToBase64;
102-
*
103-
* fn main () {
104-
* let str = "Hello, World".to_base64();
105-
* println(fmt!("%s",str));
106-
* }
107-
* ~~~~
108-
*
109-
*/
11093
impl<'self> ToBase64 for &'self str {
94+
/**
95+
* Convert any string (literal, `@`, `&`, `~`) to base64 encoding.
96+
*
97+
*
98+
* *Example*:
99+
*
100+
* ~~~~
101+
* extern mod std;
102+
* use std::base64::ToBase64;
103+
*
104+
* fn main () {
105+
* let str = "Hello, World".to_base64();
106+
* println(fmt!("%s",str));
107+
* }
108+
* ~~~~
109+
*
110+
*/
111111
fn to_base64(&self) -> ~str {
112112
str::to_bytes(*self).to_base64()
113113
}
@@ -117,26 +117,26 @@ pub trait FromBase64 {
117117
fn from_base64(&self) -> ~[u8];
118118
}
119119
120-
/**
121-
* Turn a vector of `u8`s representing characters
122-
* encoding byte values in base64 into the vector of `u8` byte values.
123-
*
124-
* *Example*:
125-
*
126-
* ~~~~
127-
* extern mod std;
128-
* use std::base64::ToBase64;
129-
* use std::base64::FromBase64;
130-
*
131-
* fn main () {
132-
* let str = [52,32].to_base64();
133-
* println(fmt!("%s", str));
134-
* let bytes = str.from_base64();
135-
* println(fmt!("%?",bytes));
136-
* }
137-
* ~~~~
138-
*/
139120
impl FromBase64 for ~[u8] {
121+
/**
122+
* Turn a vector of `u8`s representing characters
123+
* encoding byte values in base64 into the vector of `u8` byte values.
124+
*
125+
* *Example*:
126+
*
127+
* ~~~~
128+
* extern mod std;
129+
* use std::base64::ToBase64;
130+
* use std::base64::FromBase64;
131+
*
132+
* fn main () {
133+
* let str = [52,32].to_base64();
134+
* println(fmt!("%s", str));
135+
* let bytes = str.from_base64();
136+
* println(fmt!("%?",bytes));
137+
* }
138+
* ~~~~
139+
*/
140140
fn from_base64(&self) -> ~[u8] {
141141
if self.len() % 4u != 0u { fail!(~"invalid base64 length"); }
142142
@@ -198,35 +198,35 @@ impl FromBase64 for ~[u8] {
198198
}
199199
}
200200
201-
/**
202-
* Convert any string (literal, `@`, `&`, `~`)
203-
* that contains a base64 encoded value, to the byte values it encodes.
204-
*
205-
* You can use the `from_bytes` function in `core::str`
206-
* to turn a `[u8]` into a string with characters corresponding to those values.
207-
*
208-
* *Example*:
209-
*
210-
* This is an example of going from a string literal to the base64 encoding
211-
* and back to the same string.
212-
*
213-
* ~~~~
214-
* extern mod std;
215-
* use std::base64::ToBase64;
216-
* use std::base64::FromBase64;
217-
* use core::str;
218-
*
219-
* fn main () {
220-
* let hello_str = "Hello, World".to_base64();
221-
* println(fmt!("%s",hello_str));
222-
* let bytes = hello_str.from_base64();
223-
* println(fmt!("%?",bytes));
224-
* let result_str = str::from_bytes(bytes);
225-
* println(fmt!("%s",result_str));
226-
* }
227-
* ~~~~
228-
*/
229201
impl FromBase64 for ~str {
202+
/**
203+
* Convert any string (literal, `@`, `&`, `~`)
204+
* that contains a base64 encoded value, to the byte values it encodes.
205+
*
206+
* You can use the `from_bytes` function in `core::str`
207+
* to turn a `[u8]` into a string with characters corresponding to those values.
208+
*
209+
* *Example*:
210+
*
211+
* This is an example of going from a string literal to the base64 encoding
212+
* and back to the same string.
213+
*
214+
* ~~~~
215+
* extern mod std;
216+
* use std::base64::ToBase64;
217+
* use std::base64::FromBase64;
218+
* use core::str;
219+
*
220+
* fn main () {
221+
* let hello_str = "Hello, World".to_base64();
222+
* println(fmt!("%s",hello_str));
223+
* let bytes = hello_str.from_base64();
224+
* println(fmt!("%?",bytes));
225+
* let result_str = str::from_bytes(bytes);
226+
* println(fmt!("%s",result_str));
227+
* }
228+
* ~~~~
229+
*/
230230
fn from_base64(&self) -> ~[u8] {
231231
str::to_bytes(*self).from_base64()
232232
}

0 commit comments

Comments
 (0)