pub trait SliceCopiedExt {
    type Item;

    fn copied(&self) -> Vec<Self::Item>;
}
Expand description

Short hand analogous to Iter::copied, where items of &T are converted to T via copy.

use gazebo::prelude::*;

#[derive(Copy, Clone, Debug, PartialEq)]
struct X;

let x = [&X];
let y : Vec<X> = x.copied();

assert_eq!(y, vec![X]);

let x = vec![&X];
let y : Vec<X> = x.copied();

assert_eq!(y, vec![X]);

Required Associated Types

Required Methods

Implementations on Foreign Types

Implementors