Skip to content

Commit 2ba0c48

Browse files
committed
trpl: Use ordered list to release user from counting
Later in text we mention 'step four' and 'step three'. This fix releases user from counting.
1 parent c056cbb commit 2ba0c48

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/doc/trpl/lifetimes.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ With that in mind, let’s learn about lifetimes.
4343
Lending out a reference to a resource that someone else owns can be
4444
complicated. For example, imagine this set of operations:
4545

46-
- I acquire a handle to some kind of resource.
47-
- I lend you a reference to the resource.
48-
- I decide I’m done with the resource, and deallocate it, while you still have
46+
1. I acquire a handle to some kind of resource.
47+
2. I lend you a reference to the resource.
48+
3. I decide I’m done with the resource, and deallocate it, while you still have
4949
your reference.
50-
- You decide to use the resource.
50+
4. You decide to use the resource.
5151

5252
Uh oh! Your reference is pointing to an invalid resource. This is called a
5353
dangling pointer or ‘use after free’, when the resource is memory.

0 commit comments

Comments
 (0)