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

Method new

src/ll/linked_list.rs:11–17  ·  view source on GitHub ↗
(element: T)

Source from the content-addressed store, hash-verified

9
10impl<T> Node<T> {
11 fn new(element: T) -> NonNull<Self> {
12 let v = Box::new(Node {
13 element,
14 next: None,
15 });
16 Box::leak(v).into()
17 }
18}
19
20pub struct LinkedList<T> {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected