Trait gazebo::prelude::IterDuped[][src]

pub trait IterDuped: Sized {
    fn duped(self) -> Cloned<Self>;
}

Required methods

Like duped(), but only works for types that implement Dupe. Note that the return type is deliberately Cloned, as that behaves the same as a Duped would be, but can take advantage of standard library optimisations.

use gazebo::prelude::*;
use std::rc::Rc;
let inputs = vec![Rc::new("Hello"), Rc::new("World")];
let outputs = inputs.iter().duped().collect::<Vec<_>>();
assert_eq!(inputs, outputs);

use gazebo::prelude::*; use std::cmp::Ordering;

Implementors