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

When to use String and &str? | Learn Rust part 26

1.8K views on YouTube

When to use String and &str in Rust?
Why functions with str as input or output doesn’t compile

0:00 Intro
0:39 String
1:49 &String
3:01 &mut String
3:59 str
5:11 &str
6:03 &mut str
6:42 Why str cannot be used for function input and output
8:06 when to use String and str

Code https://github.com/t4sk/hello-rust
Course https://www.smartcontract.engineer/

Follow
https://odysee.com/@SmartContractProgrammer:8

https://discord.gg/bt8FK2wkcW
https://t.me/smartcontractprogrammer
https://smartcontractprogrammer.com