Hi guys, got error from the main website code

Just started learning Rust and i just love it. I wanted to notify about a small code thats giving error

Reference url in question: Getting started - Rust Programming Language

Reference code in question:

fn main() {
    let stdout = stdout();
    say(message.as_bytes(), width, &mut writer).unwrap();

seems like ferris say function definition has changed
I got it working by referencing it instead of converting to bytes

say(&message, width, &mut writer).unwrap();

If you use version 0.2 as that page says, it will work (issue 1750). There's also a ticket to update the dependency and example.

1 Like

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.