MCPcopy Create free account
hub / github.com/douchuan/algorithm / drop_with_pop

Function drop_with_pop

tests/test_linked_list.rs:92–109  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

90
91#[test]
92fn drop_with_pop() {
93 use algo::common::drop::{self, Elem};
94 drop::with(|ctx| {
95 let mut ll = LinkedList::default();
96 ll.push_back(Elem);
97 ll.push_front(Elem);
98 ll.push_back(Elem);
99 ll.push_front(Elem);
100
101 // do pop, and drop Elem
102 drop(ll.pop_front());
103 drop(ll.pop_front());
104 assert_eq!(2, ctx.get());
105
106 drop(ll);
107 assert_eq!(4, ctx.get());
108 });
109}
110
111fn create_ll<T>(data: &[T]) -> LinkedList<T>
112where

Callers

nothing calls this directly

Calls 4

withFunction · 0.85
push_backMethod · 0.80
push_frontMethod · 0.80
pop_frontMethod · 0.80

Tested by

no test coverage detected