Add example for from_byte() documenation

I'm working on adding examples to the API documentation. Should future pull requests include examples for more than one function? Or is this about the right size for a pull request?
 

Thanks, Huon. I hadn't thought of that approach. I'll redo it. 

On 2014-06-30 07:27, Huon Wilson wrote: 

> In src/libcollections/str.rs: 
> 
>> @@ -106,6 +106,20 @@ pub fn from_utf8_owned(vv: Vec<u8>) -> Result<String, Vec<u8>> {
>> /// # Failure
>> ///
>> /// Fails if invalid UTF-8
>> +///
>> +/// # Example
>> +/// 
>> +/// ```rust
>> +///
>> +/// # #![feature(globs)]
>> +/// # use std::str::*;
>> +/// # fn main() {
>> +/// let string = from_byte(66u8); 
> 
> Use these in qualified form, for clarity: 
> 
> ```rust
> use std::str;
> 
> let string = str::from_byte(66u8);
> 
> assert_eq!(string.as_slice(), "B");
> ```
> 
> --
> Reply to this email directly or view it on GitHub [1].

 

Links:
------
[1] https://github.com/rust-lang/rust/pull/15271/files#r14345395