Why you shouldn't obsess about Rust "features"

1. Why you shouldn't obsess about Rust "features"

Rust makes it very easy to express conditional compilation, especially thanks to Cargo “features”. They’re well integrated into the language and are very easy to use. But one thing I’ve learned by maintaining RSpotify (a library for the Spotify API) is that one shouldn’t obsess over them. Conditional compilation should be used when it’s the only way to solve the problem, for a number of reasons I’ll explain in this article. This might be obvious, but to me, it wasn’t so clear back when I started using Rust. Even if you’re already aware, it might be a good reminder — maybe you forgot about it in your latest project, and you added an unnecessary feature. ...

Designing an API Client in Rust: New RSpotify Version a Year Later

2. Designing an API Client in Rust: New RSpotify Version a Year Later

This article in the Rspotify series describes my journey of basically rewriting the entirety of this Rust library; around 13 months of work (in my free time), starting at September 2020, up until October 2021. I think this has given me enough experience for an article regarding API design on Rust, and perhaps those who attempt the same in the future can take some ideas and save time. Specially considering how much I’ve gone in circles and how much time I’ve “wasted” implementing things that ended up being discarded. ...

The bane of my existence: Supporting both async and sync code in Rust

3. The bane of my existence: Supporting both async and sync code in Rust

My journey trying to support both asynchronous and blocking code in the Rspotify library. I got it working in the end, but Cargo didn’t quite like it.