Navigation Menu

Skip to content

Commit

Permalink
doc: Boxes diagram shows enum value inside box.
Browse files Browse the repository at this point in the history
  • Loading branch information
Div Shekhar committed Jan 16, 2014
1 parent bf2ab22 commit 065f936
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions doc/tutorial.md
Expand Up @@ -1020,10 +1020,10 @@ being destroyed along with the owner. Since the `list` variable above is
immutable, the whole list is immutable. The memory allocation itself is the
box, while the owner holds onto a pointer to it:

Cons cell Cons cell Cons cell
+-----------+ +-----+-----+ +-----+-----+
| 1 | ~ | -> | 2 | ~ | -> | 3 | ~ | -> Nil
+-----------+ +-----+-----+ +-----+-----+
List box List box List box List box
+--------------+ +--------------+ +--------------+ +--------------+
list -> | Cons | 1 | ~ | -> | Cons | 2 | ~ | -> | Cons | 3 | ~ | -> | Nil |
+--------------+ +--------------+ +--------------+ +--------------+

An owned box is a common example of a type with a destructor. The allocated
memory is cleaned up when the box is destroyed.
Expand Down

0 comments on commit 065f936

Please sign in to comment.