diff --git a/src/dopt.rs b/src/dopt.rs index 9c80302..58c3647 100644 --- a/src/dopt.rs +++ b/src/dopt.rs @@ -208,8 +208,8 @@ impl Docopt { /// /// For details on how decoding works, please see the documentation for /// `ArgvMap`. - pub fn deserialize<'a, 'de: 'a, D>(&'a self) -> Result - where D: de::Deserialize<'de> + pub fn deserialize(&self) -> Result + where D: de::DeserializeOwned { self.parse().and_then(|vals| vals.deserialize()) } @@ -392,7 +392,7 @@ impl ArgvMap { /// /// In this example, only the `bool` type was used, but any type satisfying /// the `Deserialize` trait is valid. - pub fn deserialize<'de, T: de::Deserialize<'de>>(self) -> Result { + pub fn deserialize(self) -> Result { de::Deserialize::deserialize(&mut Deserializer { vals: self, stack: vec![], @@ -641,9 +641,9 @@ impl Value { /// extern crate serde; /// # fn main() { /// use docopt::Docopt; -/// use serde::de::Deserialize; +/// use serde::de::DeserializeOwned; /// -/// fn deserialize<'de, D: Deserialize<'de>>(usage: &str, argv: &[&str]) +/// fn deserialize(usage: &str, argv: &[&str]) /// -> Result { /// Docopt::new(usage) /// .and_then(|d| d.argv(argv.iter()).deserialize())