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

Function iter_mut_test

publication/code/chapter04/linked_list.rs:175–185  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

173 }
174
175 fn iter_mut_test() {
176 let mut list = List::new();
177 list.push(1); list.push(2); list.push(3);
178
179 let mut iter = list.iter_mut();
180 assert_eq!(iter.next(), Some(&mut 3));
181 assert_eq!(iter.next(), Some(&mut 2));
182 assert_eq!(iter.next(), Some(&mut 1));
183 assert_eq!(iter.next(), None);
184 println!("iter_mut test Ok!");
185 }
186}

Callers 1

mainFunction · 0.70

Calls 2

pushMethod · 0.45
iter_mutMethod · 0.45

Tested by

no test coverage detected