[][src]Function tao_of_rust::ch03::tag_trait::test_copy_trait

pub fn test_copy_trait()

用作标签的trait:Copy

在Rust中一共有五种主要的标签trait:

Base usage: 检测是否实现Copy trait的函数

fn test_copy<T: Copy>(i: T) {
    println!("hhh");
}
let a = "String".to_string();
test_copy(a);Run