From 8e64b61df9a9b22dc742fcd25f0533f5b4580477 Mon Sep 17 00:00:00 2001 From: Leah Hanson Date: Sat, 13 Apr 2013 08:11:39 -0400 Subject: [PATCH] move rustdoc comments so that they attach to the functions rather than the impl blocks. --- src/libstd/base64.rs | 158 +++++++++++++++++++++---------------------- 1 file changed, 79 insertions(+), 79 deletions(-) diff --git a/src/libstd/base64.rs b/src/libstd/base64.rs index 618f5ecccf73c..5b1e82ce1f00e 100644 --- a/src/libstd/base64.rs +++ b/src/libstd/base64.rs @@ -26,22 +26,22 @@ static CHARS: [char, ..64] = [ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '/' ]; -/** - * Turn a vector of `u8` bytes into a string representing them in base64. - * - * *Example*: - * - * ~~~~ - * extern mod std; - * use std::base64::ToBase64; - * - * fn main () { - * let str = [52,32].to_base64(); - * println(fmt!("%s", str)); - * } - * ~~~~ - */ impl<'self> ToBase64 for &'self [u8] { + /** + * Turn a vector of `u8` bytes into a string representing them in base64. + * + * *Example*: + * + * ~~~~ + * extern mod std; + * use std::base64::ToBase64; + * + * fn main () { + * let str = [52,32].to_base64(); + * println(fmt!("%s", str)); + * } + * ~~~~ + */ fn to_base64(&self) -> ~str { let mut s = ~""; unsafe { @@ -90,24 +90,24 @@ impl<'self> ToBase64 for &'self [u8] { } } -/** - * Convert any string (literal, `@`, `&`, `~`) to base64 encoding. - * - * - * *Example*: - * - * ~~~~ - * extern mod std; - * use std::base64::ToBase64; - * - * fn main () { - * let str = "Hello, World".to_base64(); - * println(fmt!("%s",str)); - * } - * ~~~~ - * - */ impl<'self> ToBase64 for &'self str { + /** + * Convert any string (literal, `@`, `&`, `~`) to base64 encoding. + * + * + * *Example*: + * + * ~~~~ + * extern mod std; + * use std::base64::ToBase64; + * + * fn main () { + * let str = "Hello, World".to_base64(); + * println(fmt!("%s",str)); + * } + * ~~~~ + * + */ fn to_base64(&self) -> ~str { str::to_bytes(*self).to_base64() } @@ -117,26 +117,26 @@ pub trait FromBase64 { fn from_base64(&self) -> ~[u8]; } -/** - * Turn a vector of `u8`s representing characters - * encoding byte values in base64 into the vector of `u8` byte values. - * - * *Example*: - * - * ~~~~ - * extern mod std; - * use std::base64::ToBase64; - * use std::base64::FromBase64; - * - * fn main () { - * let str = [52,32].to_base64(); - * println(fmt!("%s", str)); - * let bytes = str.from_base64(); - * println(fmt!("%?",bytes)); - * } - * ~~~~ - */ impl FromBase64 for ~[u8] { + /** + * Turn a vector of `u8`s representing characters + * encoding byte values in base64 into the vector of `u8` byte values. + * + * *Example*: + * + * ~~~~ + * extern mod std; + * use std::base64::ToBase64; + * use std::base64::FromBase64; + * + * fn main () { + * let str = [52,32].to_base64(); + * println(fmt!("%s", str)); + * let bytes = str.from_base64(); + * println(fmt!("%?",bytes)); + * } + * ~~~~ + */ fn from_base64(&self) -> ~[u8] { if self.len() % 4u != 0u { fail!(~"invalid base64 length"); } @@ -198,35 +198,35 @@ impl FromBase64 for ~[u8] { } } -/** - * Convert any string (literal, `@`, `&`, `~`) - * that contains a base64 encoded value, to the byte values it encodes. - * - * You can use the `from_bytes` function in `core::str` - * to turn a `[u8]` into a string with characters corresponding to those values. - * - * *Example*: - * - * This is an example of going from a string literal to the base64 encoding - * and back to the same string. - * - * ~~~~ - * extern mod std; - * use std::base64::ToBase64; - * use std::base64::FromBase64; - * use core::str; - * - * fn main () { - * let hello_str = "Hello, World".to_base64(); - * println(fmt!("%s",hello_str)); - * let bytes = hello_str.from_base64(); - * println(fmt!("%?",bytes)); - * let result_str = str::from_bytes(bytes); - * println(fmt!("%s",result_str)); - * } - * ~~~~ - */ impl FromBase64 for ~str { + /** + * Convert any string (literal, `@`, `&`, `~`) + * that contains a base64 encoded value, to the byte values it encodes. + * + * You can use the `from_bytes` function in `core::str` + * to turn a `[u8]` into a string with characters corresponding to those values. + * + * *Example*: + * + * This is an example of going from a string literal to the base64 encoding + * and back to the same string. + * + * ~~~~ + * extern mod std; + * use std::base64::ToBase64; + * use std::base64::FromBase64; + * use core::str; + * + * fn main () { + * let hello_str = "Hello, World".to_base64(); + * println(fmt!("%s",hello_str)); + * let bytes = hello_str.from_base64(); + * println(fmt!("%?",bytes)); + * let result_str = str::from_bytes(bytes); + * println(fmt!("%s",result_str)); + * } + * ~~~~ + */ fn from_base64(&self) -> ~[u8] { str::to_bytes(*self).from_base64() }