docs tests are passing

This commit is contained in:
debris 2015-12-08 12:40:11 +01:00
parent 4e79fc641c
commit db762c534e
2 changed files with 3 additions and 3 deletions

View File

@ -116,7 +116,7 @@ pub trait View<'a, 'view>: Sized {
/// fn main () {
/// let data = vec![0xc8, 0x83, b'c', b'a', b't', 0x83, b'd', b'o', b'g'];
/// let rlp = Rlp::new(&data);
/// let dog = String::decode(&rlp.at(1));
/// let dog: String = rlp.at(1).as_val();
/// assert_eq!(dog, "dog".to_string());
/// }
fn at(&'view self, index: usize) -> Self::Item;
@ -201,7 +201,7 @@ pub trait View<'a, 'view>: Sized {
/// fn main () {
/// let data = vec![0xc8, 0x83, b'c', b'a', b't', 0x83, b'd', b'o', b'g'];
/// let rlp = Rlp::new(&data);
/// let strings: Vec<String> = rlp.iter().map(| i | String::decode(&i)).collect();
/// let strings: Vec<String> = rlp.iter().map(| i | i.as_val()).collect();
/// }
/// ```
fn iter(&'view self) -> Self::Iter;

View File

@ -1119,7 +1119,7 @@ mod tests {
use std::{fmt, cmp};
use std::str::FromStr;
use rlp;
use rlp::{UntrustedRlp, RlpStream, Decodable, View};
use rlp::{UntrustedRlp, RlpStream, Decodable, View, Stream, Encodable};
use uint::U256;
#[test]