This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// enums3.rs | |
// Address all the TODOs to make the tests pass! | |
// I AM NOT DONE | |
enum Message { | |
// TODO: implement the message variant types based on their usage below | |
Move {x: i32, y: i32}, | |
Echo (String), | |
ChangeColor (i32, i32, i32), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// simple calculator app in Rust | |
use std::io::{stdin, stdout, Write}; | |
// create a function | |
fn read(input: &mut String) { | |
stdout().flush().expect("failed to flush"); | |
stdin().read_line(input).expect("failed to read"); | |
} | |
fn main() { |