rust-lang / book

The Rust Programming Language

Home Page:https://doc.rust-lang.org/book/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Chapter 15.3 has "drop(c);" instead of "std::mem::drop(c)"

opened this issue · comments

  • I have searched open and closed issues and pull requests for duplicates, using these search terms:
    • 15.3
  • I have checked the latest main branch to see if this has already been fixed, in this file:
    • 15.3

URL to the section(s) of the book with this problem:
doc.rust-lang.org/book/ch15-03-drop.html

Description of the problem:
Listing 15-16 has "drop(c);" instead of "std::mem::drop(c)"

Suggested fix:
crtl + c, crtl + v

As stated in the text before listing 15-16:

The function is in the prelude, so we can modify main in Listing 15-15 to call the drop function, as shown in Listing 15-16: