curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
cargo new PROJECT_NAME
cargo add ferris-says
cargo build
cargo run
use ferris_says::say; // from the previous step
use std::io::{stdout, BufWriter};
fn main() {
let stdout = stdout();
let message = String::from("Hello fellow Rustaceans!");
let width = message.chars().count();
let mut writer = BufWriter::new(stdout.lock());
say(&message, width, &mut writer).unwrap();
}
11.03.2024 Ownership, memory managment -> https://doc.rust-lang.org/book/ch04-01-what-is-ownership.html#the-string-type
References: