MCPcopy Create free account
hub / github.com/QMHTMY/RustBook / main

Function main

code/chapter03/lvec.rs:134–151  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

132}
133
134fn main() {
135 let mut lvec: LVec<i32> = LVec::new();
136 lvec.push(10); lvec.push(11);
137 lvec.push(12); lvec.push(13);
138 lvec.insert(0,9);
139
140 let mut lvec2: LVec<i32> = LVec::new();
141 lvec2.insert(0, 8);
142 lvec2.append(&mut lvec);
143 println!("lvec2 len: {}", lvec2.len());
144 lvec2.print_lvec();
145
146 let res1 = lvec2.pop();
147 let res2 = lvec2.remove(0);
148 println!("pop {:?}", res1.unwrap());
149 println!("remove {:?}", res2.unwrap());
150 lvec2.print_lvec();
151}

Callers

nothing calls this directly

Calls 6

pushMethod · 0.45
insertMethod · 0.45
appendMethod · 0.45
print_lvecMethod · 0.45
popMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected