pub fn add_optional<T, F, R>(&self, node: &'ast Option<T>, f: F) -> Result<Option<R>>
    where
        F: FnOnce(&Self, &'ast T) -> Result<R>,
    {
        Ok(match *node {
            Some(ref ast) => Some(f(self, ast)?),
            None => None,
        })
    }
/// Add an optional node.
///
/// This convenience function performs a few things at a time. First it
/// applies a closure `f` to the value of an option, returning an error if
/// the closure returns one. Otherwise it wraps the result in an option and
/// returns it.
Add an optional node.
This convenience function performs a few things at a time. First it
applies a closure `f` to the value of an option, returning an error if
the closure returns one. Otherwise it wraps the result in an option and
returns it.
Add an optional node . This convenience function performs a few things at a time . First it applies a closure ` f ` to the value of an option returning an error if the closure returns one . Otherwise it wraps the result in an option and returns it .
pub fn add_optional<T, F, R>(&self, node: &'ast Option<T>, f: F) -> Result<Option<R>>
    where
        F: FnOnce(&Self, &'ast T) -> Result<R>,
    {
        Ok(match *node {
            Some(ref ast) => Some(f(self, ast)?),
            None => None,
        })
    }
pub fn add_optional < T , F , R > ( & self , node : & ' ast Option < T > , f : F ) -> Result < Option < R > > where F : FnOnce ( & Self , & ' ast T ) -> Result < R > , { Ok ( match * node { Some ( ref ast ) => Some ( f ( self , ast ) ? ) , None => None , } ) }
Add an optional node.
Add an optional node .
&self
node
&'ast Option<T>
f
F
&self
node
&'ast Option<T>
f
F