Skip to content

PRO TIP Block youtube.com at the DNS level — Pi-hole, NextDNS or your hosts file — but allow youtube-nocookie.com and i.ytimg.com. These tutorials keep playing; the rabbit hole does not.

Learning without distractions

Rust Programming Tutorial #30 – Reading User Input

28.5K views on YouTube

dcode 42 tutorials here

One of the most important things in a program is to read user input and in this video I show you how you can do this in Rust.

It is done through the stdin struct/stream and in this example we use the read_line method to feed user input from the console into a mutable String.

For more info, check out:
https://doc.rust-lang.org/std/io/struct.Stdin.html

If this video helped you out and you’d like to see more, make sure to leave a like and subscribe to dcode!