Skip to content

Commit f2ea028

Browse files
authored
Improve/fix description of drops
1 parent 14649f1 commit f2ea028

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/destructors.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ struct Boxy<T> {
102102
}
103103
```
104104

105-
will have its data1 and data2's fields destructors whenever it "would" be
105+
will have the destructors of its `data1` and `data2` fields called whenever it "would" be
106106
dropped, even though it itself doesn't implement Drop. We say that such a type
107107
*needs Drop*, even though it is not itself Drop.
108108

@@ -163,8 +163,8 @@ impl<T> Drop for SuperBox<T> {
163163
# fn main() {}
164164
```
165165

166-
However this has fairly odd semantics: you're saying that a field that *should*
167-
always be Some *may* be None, just because that happens in the destructor. Of
166+
However this has fairly odd semantics: you are saying that a field that *should*
167+
always be Some *may* be None, just because of what happens in the destructor. Of
168168
course this conversely makes a lot of sense: you can call arbitrary methods on
169169
self during the destructor, and this should prevent you from ever doing so after
170170
deinitializing the field. Not that it will prevent you from producing any other

0 commit comments

Comments
 (0)