From af84924b488085197a1499230d186c6d348402c4 Mon Sep 17 00:00:00 2001 From: Anubhav Singh Date: Tue, 18 Feb 2025 22:23:58 +0530 Subject: [PATCH] Crarified the misunderstanding b/w crates, module, items The issue is while in std::io::stdin: std is the standard library in Rust. io is a module within the std library. stdin is a function within the io module, but the book said "io library" it does confused too much as a newbie the user won't impose his thoughts for a moment he/she will rather trust the BOOK that ::io is indeed a library (with confusion in his mind). so it needs to be fixed. --- src/ch02-00-guessing-game-tutorial.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ch02-00-guessing-game-tutorial.md b/src/ch02-00-guessing-game-tutorial.md index 9aed0208e0..c3bbf8dfae 100644 --- a/src/ch02-00-guessing-game-tutorial.md +++ b/src/ch02-00-guessing-game-tutorial.md @@ -178,7 +178,7 @@ input: {{#rustdoc_include ../listings/ch02-guessing-game-tutorial/listing-02-01/src/main.rs:read}} ``` -If we hadn’t imported the `io` library with `use std::io;` at the beginning of +If we hadn’t imported the `io` module from std library with `use std::io;` at the beginning of the program, we could still use the function by writing this function call as `std::io::stdin`. The `stdin` function returns an instance of [`std::io::Stdin`][iostdin], which is a type that represents a