Tag Archives: Rust

Optional Values in Rust

Let’s say we are writing some code to retrieve data from a database. If the data we are looking for is there, we can obviously return it. If there is no data that matches our search, we need to signal that we did not find it. In many languages, we use a nil, null, or… Read More »

Rust Error Handling, Part Two

In the previous post, I covered a quick overview of error handling approaches in different languages. Then, I introduced Rust’s error handling using the Result<T, E> enum. This time we’ll look at how Rust’s approach improves on other techniques. Compared to Error Returns Returning a Result<T, E> from a function is very much like the… Read More »

Rust Error Handling, Part One

For the last couple of years, I’ve been learning Rust in my free time (ha!) by working on side projects. Since I don’t really have a deadline, I can focus on seeing how Rust changes the way I think about programming. A language that doesn’t affect the way you think about programming is not worth… Read More »