/rust_scrapbook

This is a repository for any and all rudimentary Rust programming as I learn the language.

Primary LanguageRust

RustScrapbook

This is a repository for any and all rudimentary Rust programming as I learn the language.

Examples

The most fleshed out examples of my work are:

  • distribution - A short CLI program which can take in any number of real numbers and report the median, mean, and mode of the distribution. This helped me to learn how to interact with Rust's safety system and handling Rust collections, like Vec and HashMap
  • pig_latin - A short CLI program which can take in any sentence and return it in pig-latin with correct capitalization (i.e. "Don't take that!" -> "On't-day ake-tay at-thay!"). Probably the most interesting part about this program was learning how to interact with Rust Strings, which are unruly due to the way that Rust handles safety and also the way Rust has UTF-8 functionality (such that there is no simple concept of a char[] out of a String). I enjoyed getting the capitalization to stay consistent and finding where the true start of a word should be (such as in proper nouns like "Thaddeus").
  • employee_index - I came back to learning Rust after a hiatus over the winter with this project. As such, I spent some time relearning the concepts of referencing and unique references. It was surprising how many tools Rust has for simplifying syntax if you are very experienced, and after seeking some help from the official Rust Language Discord I got a lot more intimately familiar with the methods available in the Rust standard library. The biggest challenges here were really in conceptualizing the best way to store the employee & department information, and the best way to identify and acquire the names of employees and department (for confusing inputs such as "Add John Toleno to Access to Security Level Two"). I'm certain there was a less verbose way to acquire the outputs, but I'm satisfied with how it ended out and I learned a lot in the process.