MCPcopy Create free account
hub / github.com/Apress/beginning-rust-2e / clone

Method clone

Source Code/22-29.rs:6–8  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

4 struct S { x: Vec<i32> }
5 impl Clone for S {
6 fn clone(&self) -> Self {
7 S { x: self.x.clone() }
8 }
9 }
10 let mut s1 = S { x: vec![12] };
11 let s2 = s1.clone();

Callers 1

mainFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected