From edbde774a772ba68dfe5e04844beb10f4a2150dc Mon Sep 17 00:00:00 2001 From: Steve Klabnik Date: Wed, 30 Jul 2014 10:09:03 -0400 Subject: [PATCH] Fix heading levels in pointer guide --- src/doc/guide-pointers.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/doc/guide-pointers.md b/src/doc/guide-pointers.md index 5ec16e852a5f9..349020313e8e8 100644 --- a/src/doc/guide-pointers.md +++ b/src/doc/guide-pointers.md @@ -578,12 +578,12 @@ fn main() { Notice we changed the signature of `add_one()` to request a mutable reference. -# Best practices +## Best practices Boxes are appropriate to use in two situations: Recursive data structures, and occasionally, when returning data. -## Recursive data structures +### Recursive data structures Sometimes, you need a recursive data structure. The simplest is known as a 'cons list': @@ -615,7 +615,7 @@ we don't know the size, and therefore, we need to heap allocate our list. Working with recursive or other unknown-sized data structures is the primary use-case for boxes. -## Returning data +### Returning data This is important enough to have its own section entirely. The TL;DR is this: you don't generally want to return pointers, even when you might in a language