9 Rust Best Practices - Utils, Examples, Tests (Part 2/3)

Опубликовано: 27 Февраль 2026
на канале: Jeremy Chone
7,104
222

This is part 2/3 of the 9 Rust Programming best practices I am using when building a library. We will continue to use a real library, genai, as an example.

In addition, we will write a real unit test for the library.

Part 1:    • 9 Rust Best Practices with Real Lib (part ...  
Part 2 (this one):    • 9 Rust Best Practices - Utils, Examples, T...  
Part 3:    • 9 Rust Best Practices - Async, Project Fil...  
In this episode, we will go through the following four chapters:

1) (c04) Utils and Trait Extensions best practices (for single crate and multi-crates project)
2) (c05) Examples best practices
3) (c06) Integration and Unit Testing best practices

00:00 - Intro
00:19 - c04: Utils & Support
10:03 - c04: Extension Trait Intro
12:22 - c04: ValueExt (Extension trait by example)
19:27 - c05: Examples best practices
25:05 - c06: Integration Tests code review
35:23 - c06: Unit Tests, by example

c01..c03 are in the part 1 video:    • 9 Rust Best Practices with Real Lib (part ...  

Part 3 coming soon.

== Jeremy Chone:

Discord general-rust -   / discord  
Discord rust10x -   / discord  
Patreon -   / jeremychone   - Any help is a big help (for Rust educational content)
Twitter -   / jeremychone  

https://britesnow.com - BriteSnow is my enterprise consulting company I have been running for 15 years. We help enterprises build and modernize next-gen applications. Feel free to send an email to [email protected] if you have any questions.

Big thanks to CrabNebula (https://crabnebula.dev/) for sponsoring this channel.

== Jeremy Chone Rust Video Playlists:

Everything Rust Programming - Tutorials, Courses, Tips, Examples:    • JC - Rust - Everything Rust Programming - ...  
Rust AI Programming Series:    • JC - Rust & AI Programming  
Rust Web App Production Coding Series:    • JC - Rust Production Coding - Web App Series  
Rust For Desktop App:    • JC - Rust Programming for Desktop App  
Rust Programming for Web Development:    • JC - Rust Programming for Web Development  
Rust Courses:    • Rust Course 2021 by the book | RustLang  
Rust for Java Developers:    • Rust for Java Developers