From 681fd0c0c9f37976d66509f50aea616c519ed362 Mon Sep 17 00:00:00 2001 From: Walidoux Date: Tue, 30 Jan 2024 10:23:01 +0100 Subject: [PATCH] docs(chap1): extend info about usage of prelude --- chapter_1_getting_started/src/main.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/chapter_1_getting_started/src/main.rs b/chapter_1_getting_started/src/main.rs index 00d4d6e..4b8263b 100644 --- a/chapter_1_getting_started/src/main.rs +++ b/chapter_1_getting_started/src/main.rs @@ -1,5 +1,7 @@ // Scope of a program => prelude // If a type you want to use isn't in the prelude, you have to bring that type into scope explicitly with a `use` statement. +// Sometimes it's best not to use the prelude to ->avoid name conflicts<-when importing other crates, or especially when using +// common data structures for instance HashMaps because of ->performance reasons<-, so we tend to use std::collections::BTreeMap instead use std::io::{self, Write}; /**