diff --git a/src/rlp/faces.rs b/src/rlp/faces.rs index f55b5584e..078620de2 100644 --- a/src/rlp/faces.rs +++ b/src/rlp/faces.rs @@ -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 = rlp.iter().map(| i | String::decode(&i)).collect(); + /// let strings: Vec = rlp.iter().map(| i | i.as_val()).collect(); /// } /// ``` fn iter(&'view self) -> Self::Iter; diff --git a/src/rlp/old.rs b/src/rlp/old.rs index dd09ea548..1c4147463 100644 --- a/src/rlp/old.rs +++ b/src/rlp/old.rs @@ -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]