-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Description
…since the testing code generated by cargo automatically includes the line
use super::*;, the following paragraph in Chapter 1.1 which describes this line being manually added to Listing 11-6 and the reason for doing so is misleading. Perhaps the paragraph should be moved to Listing 11-1, and altered so that is explaining why the line is (already) there.Note that we’ve added a new line inside the
testsmodule:use super::*;.
Thetestsmodule is a regular module that follows the usual visibility rules
we covered in Chapter 7 in the [“Paths for Referring to an Item in the Module
Tree”][paths-for-referring-to-an-item-in-the-module-tree]
section. Because thetestsmodule is an inner module, we need to bring the
code under test in the outer module into the scope of the inner module. We use
a glob here so anything we define in the outer module is available to this
testsmodule.
Originally posted by @matthewjnield in #3630 (comment)