Skip to content

Commit 0a70c94

Browse files
committed
Semantic accuracy in borrow scope rules.
The text claimed 'any borrow must last for a _smaller_ scope than the owner', however the accurate way of describing the comparison is inclusive (i.e., 'less than or equal to' vs. 'less than').
1 parent 7b0f2af commit 0a70c94

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/doc/trpl/references-and-borrowing.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,9 @@ As it turns out, there are rules.
151151

152152
Here’s the rules about borrowing in Rust:
153153

154-
First, any borrow must last for a smaller scope than the owner. Second, you may
155-
have one or the other of these two kinds of borrows, but not both at the same
156-
time:
154+
First, any borrow must last for a scope no greater than that of the owner.
155+
Second, you may have one or the other of these two kinds of borrows, but not
156+
both at the same time:
157157

158158
* one or more references (`&T`) to a resource.
159159
* exactly one mutable reference (`&mut T`)

0 commit comments

Comments
 (0)