Max Carlquist

Rust Calculator

Project Page
rust calculator

I built this a challenge from Linkedin Learning and yes it was challenging and fun.

I learned about how to use the std library and how to read arguments from the Command Line. This was really fun to understand because I really enjoy the communication between people and reading arguments from within a CLI is the CLI's way of talking to you - I guess...

I mean how cool isn't this line?

use std::env::{args, Args};

fn main() {
let mut args: Args = args(); // retrieve args from CLI

let first = args.nth(1).unwrap(); // Get the first value
let second = args.nth(0).unwrap();

println!("first argument is {} and second is {} ", first, second);

I also learned about how functions return well anything, according to what you write after the ->

Finally the fun thing about this project that I learned was about the match keyword. Its quite amazing how easy it is to use this method of conditionally rendering different scenarios, in this case (and probably in many other cases) one line.