Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Currently, Copy trait cannot be implemented
- // impl<T> Copy for Vector<T> {}
- impl<T> Clone for Vector<T> where T: Copy + fmt::Display + num::Num {
- fn clone(&self) -> Vector<T> {
- let mut vec: Vec<T> = Vec::new();
- for i in 0..(self.vec.len()) {
- vec.push(self.vec[i]);
- }
- Vector::<T>{ vec: vec }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement