]> git.lizzy.rs Git - rust.git/commit
auto merge of #11567 : divtxt/rust/master, r=cmr
authorbors <bors@rust-lang.org>
Sun, 19 Jan 2014 04:31:47 +0000 (20:31 -0800)
committerbors <bors@rust-lang.org>
Sun, 19 Jan 2014 04:31:47 +0000 (20:31 -0800)
commit1a9641bf8e02230427a6e90e6662b879dec8caf2
tree24eb5905fbfb7852d53d2d11a11ea4ed8880f03d
parentdbce62c6bbcb58e19e467f7aa4e15fc5628926d3
parent8f93d39c75ef7964ea1dfb5cd8155dd29e61b76b
auto merge of #11567 : divtxt/rust/master, r=cmr

I found the boxes diagram in the tutorial misleading about how the enum worked.

The current diagram makes it seem that there is a separate Cons struct when there is only one type of struct for the  List type, and Nil is drawn almost as if it's not consuming memory.

I'm aware of the optimization that happens for this enum which takes advantage of the fact that pointer cannot be null but this is an implementation detail and not the only one that applies here.  I can add a note below the diagram mentioning this if you like.