Refactoring Rust

In this hands-on workshop, we refactor a Rust program that has just left the prototyping stage into code that is a delight to read and follow, easy to use, easy to maintain, and that plays along nicely with the ecosystem.

NOTE: according to the instructor, there will be a coffee break in the afternoon (about 16:30).

Abstract

Rust is undeniably syntax-heavy. There’s a lot of intent to express, and Rust wants you to be explicit. All the extra effort can result in bloated code and hard-to-use APIs. Especially features like the trait system, error handling, and ownership add another layer of complexity that can't be controlled by the usual refactoring techniques we have been teaching for the last decades.

This doesn't need to be this way. Rust is an elegant language, and it has many means to reduce clutter. This is what we will focus on in this workshop. We take a real-world program and refactor it piece by piece. In doing so, we will learn about the following topics:
- Effective use of syntax and built-in methods
- Error handling, error boundaries, and happy path programming
- Abstracting with traits
- Possibilities for polymorphism: Generics, trait objects, enums
- How type inference for `Default::default()`, `Into::into()` works - Working with Iterators
- Designing for Ownership

As a last step, we will write a new feature for both the original and the refactored version. The comparison will amaze you!

RustLab is a conference made by Develer.
Develer is a company based in Campi Bisenzio, near Florence. Our motto is : "Technology to give life to your products". We produce hardware and software to create exceptional products and to improve industrial processes and people's well being.
In Develer we have passion for the new technologies and we offer our clients effective solutions that are also efficient, simple and safe for the end users. We also believe in a friendly and welcoming environment where anybody can give their contribution. This passion and this vision are what we've been driven to organize our conference "made by developers for developers".

Subscribe to our newsletter

We hate spam just as much as you do, which is why we promise to only send you relevant communications. We respect your privacy and will never share your information with third parties.
©2025 RustLab | The international conference on Rust in Florence-Design & devCantiere Creativo-Made withDatoCMS