Required Methods
sourcefn duped(self) -> Cloned<Self>
fn duped(self) -> Cloned<Self>
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;