[][src]Trait libsugar::side_effect::Also

pub trait Also: Sized {
    pub fn also<F: FnOnce(&Self)>(self, f: F) -> Self;
}

Create an implicit variable, do some extra thing, and return it

Example

let v = 1.also(|v| { println!("{}", v) });
assert_eq!(v, 1);

Required methods

pub fn also<F: FnOnce(&Self)>(self, f: F) -> Self[src]

Create an implicit variable, do some extra thing, and return it

Example

let v = 1.also(|v| { println!("{}", v) });
assert_eq!(v, 1);
Loading content...

Implementors

impl<T> Also for T[src]

Loading content...