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 4 Listing 7-18 typo

dominik-lenda opened this issue · comments

  • I have searched open and closed issues and pull requests for duplicates, using these search terms:

  • I have checked the latest main branch to see if this has already been fixed, in this file:

URL to the section(s) of the book with this problem:
https://doc.rust-lang.org/book/ch07-04-bringing-paths-into-scope-with-the-use-keyword.html#using-nested-paths-to-clean-up-large-use-lists

Description of the problem:
Listing 7-18 contains:
use std::{cmp::Ordering, io};

Suggested fix:
From my understanding it should be use std::cmp::{Ordering, io};

Sorry, I'm not sure why you got that impression because what you've suggested doesn't compile: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=47ce49e6efffbdf53eb1ba6720fdce0e

The io module is under std, not std::cmp.