Skip to content

Commit 67b8988

Browse files
author
Edoardo Molinatti
authored
A small Rust application - little improvement #1088 (#1094)
- Little change to improve readability and flexibility of "A small Rust application" sectio9n ("get-started" page)
1 parent 6d65d0f commit 67b8988

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

templates/learn/get-started.hbs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,12 @@ ferris-says = "0.1"</code></pre>
9090
use std::io::{stdout, BufWriter};
9191

9292
fn main() {
93-
let stdout = stdout();
94-
let out = b"Hello fellow Rustaceans!";
95-
let width = 24;
93+
let stdout = stdout();
94+
let message = String::from("Hello fellow Rustaceans!");
95+
let width = message.chars().count();
9696

9797
let mut writer = BufWriter::new(stdout.lock());
98-
say(out, width, &mut writer).unwrap();
98+
say(message.as_bytes(), width, &mut writer).unwrap();
9999
}
100100
</code></pre>
101101
{{/fluentparam}}

0 commit comments

Comments
 (0)