Anonymous user
Doubly-linked list/Element definition: Difference between revisions
Doubly-linked list/Element definition (view source)
Revision as of 21:58, 20 November 2015
, 8 years ago→The behind-the-scenes implementation
Line 795:
}</lang>
=== The behind-the-scenes implementation ===
Doubly linked lists present a problem in Rust due to its ownership model. There cannot be two mutable references to the same object, so what are we to do? Below are the relevant lines (with added comments) from the <code>std</code> implementation ([https://doc.rust-lang.org/std/collections/struct.LinkedList.html Documentation] [https://github.com/rust-lang/rust/blob/master/src/libcollections/linked_list.rs Source]).
|