diff options
Diffstat (limited to 'hello-rust/src/main.rs')
-rw-r--r-- | hello-rust/src/main.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/hello-rust/src/main.rs b/hello-rust/src/main.rs new file mode 100644 index 0000000..c6a8c27 --- /dev/null +++ b/hello-rust/src/main.rs @@ -0,0 +1,11 @@ +use ferris_says::say; +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.as_bytes(), width, &mut writer).unwrap(); +} |