Sblog

Category listing for Rust

Rust workspaces

Date: 2023-01-15

I've recently come to try out workspaces in Rust and I love them. Rust workspaces are groups of crates that work together. Here are some selling points:

Easy to set up

Setting up couldn't be simpler - all you need is a single Cargo.toml file with a single section that defines what crates you have in the workspace. Example:

[workspace]
members = ["api", "core", "cli"]

Common lock file

All of your crates within the workspace have a common Cargo.lock that lives in the ma...

AoC 2022 - Days 3 to 10

Date: 2022-12-10

Day 3

Description: https://adventofcode.com/2022/day/3
Solution: https://github.com/stygian91/advent-of-code-2022/tree/master/rs/q_3

Day 3 was not very exciting - the exercise consisted of some basic string manipulation.

Day 4

Description: https://adventofcode.com/2022/day/4
Solution: [https://github.com/stygian91/advent-of-cod...

AoC 2022 - Day 2

Date: 2022-12-02

I've created a new repo for the AoC 2022 here https://github.com/stygian91/advent-of-code-2022/tree/master/

Today's exercise was pretty easy again (you can find it here). The most fun part was modelling the problem with Rust's nice enums and match statements. I made a utility method that gives you the corresponding hand based on the player's hand and the desired result. I used this to f...

Advent of Code 2022 - Day 1

Date: 2022-12-01

Advent of code 2022 has started.

The first day's task is certainly easy, as expected. You can find the exercise description here: https://adventofcode.com/2022/day/1.

I'm using advent of code as an exercise to get more familiar with Rust. I am going to be using .unwrap() here as I don't feel like proper error handling is needed in the context of these exercises.

I feel like this solution is simple enough that understanding the code should be easy...