pretzelhammer / rust-blog

Educational blog posts for Rust beginners
Apache License 2.0
7.11k stars 380 forks source link

Mention that Read & Write aren't in the prelude when talking about Generic blanket impls #36

Closed Akeboshiwind closed 3 years ago

Akeboshiwind commented 3 years ago

First off, amazing article! Thanks so much for writing it, it looks like a great reference and I've learnt way more than I probabaly need to know 😅.

In the Read & Write section you mention the Generic blanket impls. You already mention this in the Scope section, but I think it's worth reiterating that Read & Write aren't in the prelude so if you want to use these blanket impls you need to bring them into scope. I think it's a common enough gottcha that a lot of people would be thankfull to be reminded.

lebensterben commented 3 years ago

It clearly has

use std::io::Read;
use std::io::Write;

in this section.

Akeboshiwind commented 3 years ago

Yeah, but people tend to skip over the imports when reading code. It would be good to mention it in the text.

On Sat, 24 Apr 2021, 15:34 Lucius Hu, @.***> wrote:

It clearly has

use std::io::Read;use std::io::Write;

in this section.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/pretzelhammer/rust-blog/issues/36#issuecomment-826101935, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACD2NAQTUAFBLYM6AJY5ITDTKLJIPANCNFSM43QFWACA .

lebensterben commented 3 years ago

I think it's a common enough gottcha that a lot of people would be thankfull to be reminded.

No thanks. This article is already too long. No need to add redundant information.

Akeboshiwind commented 3 years ago

Fair enough 👍

On Sat, Apr 24, 2021 at 4:37 PM Lucius Hu @.***> wrote:

I think it's a common enough gottcha that a lot of people would be thankfull to be reminded.

No thanks. This article is already too long. No need to add redundant information.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/pretzelhammer/rust-blog/issues/36#issuecomment-826110502, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACD2NATZ4EA2KQWGOTQ5PRLTKLQVHANCNFSM43QFWACA .