Rust Code Snippets


Basic Finite State Machine

A simple, finite state machine. I strongly recommend using an enum as T.

Basic Queue

A simple, vector-based queue data structure and related behaviors. Use enqueue() to add an element to the end of the queue and dequeue()to remove an element from the front of the queue.

Simple Unit Test

These are basic unit tests in Rust. They often populate the same file as the functions and modules they're built to test. You can run them by executing cargo test in the terminal.