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

Method into_vec

src/common/top_m.rs:28–35  ·  view source on GitHub ↗
(mut self)

Source from the content-addressed store, hash-verified

26 }
27
28 pub fn into_vec(mut self) -> Vec<T> {
29 let mut vec = Vec::with_capacity(self.m);
30 while let Some(v) = self.pq.dequeue() {
31 vec.push(v);
32 }
33 vec.reverse();
34 vec
35 }
36}

Callers

nothing calls this directly

Calls 3

pushMethod · 0.80
dequeueMethod · 0.45
reverseMethod · 0.45

Tested by

no test coverage detected