Challenge 1: A shop::inventory Module Tree — Possible Solution ==================================================================== pub mod shop { pub mod inventory { pub fn check_stock() { println!("Checking stock..."); } } } // Called from outside the shop module (e.g. from main or another module): shop::inventory::check_stock(); WHY THIS WORKS AS AN ANSWER ------------------------------ The full path from outside the shop module is shop::inventory::check_stock() — each segment of the path corresponds to one level of the module tree: the top-level shop module, its inventory submodule, and finally the check_stock function itself. pub IS REQUIRED AT EVERY LEVEL for this call to succeed from outside: shop itself must be pub (otherwise nothing outside the file/module it's defined in can even refer to shop at all), inventory must be pub (otherwise it's private to shop, invisible to code reaching in from outside), and check_stock must be pub (otherwise it's private to inventory, invisible even to code that CAN see the inventory module itself). This is exactly this chapter's "pub all the way up" rule — marking only check_stock as pub while leaving shop or inventory private would make check_stock unreachable from outside despite its own pub marker, since the path getting there is blocked at an earlier, non-public segment.