Explore principles for maintaining clean code with multiple structs and enums in Rust. Learn about struct and enum collaboration, trait objects, dynamic dispatch, managing dependencies, practicing polymorphism, and handling errors across structs.
Overview
Syllabus
- Unit 1: Understanding Code Smells in Rust
- Refactoring Feature Envy in Rust Structs
- Refactoring Message Chains in Rust
- Middle Man Code Smell Refactoring in Rust
- Unit 2: Clean Code with Traits in Rust
- Implementing Traits for Payment Flexibility
- Payment Processing with Traits in Rust
- Refactoring Document Processing with Traits in Rust
- Unit 3: Effective Dependency Management in Rust
- Decoupling Dependency Management in Rust
- Refactoring to Use Trait-Based Dependency Injection in Rust
- Implementing the Factory Pattern in Rust
- Unit 4: Applying Polymorphism in Rust with Traits and Structs
- Mastering Polymorphism with Traits in Rust
- Refactoring Animal Behaviors in Rust Using Traits
- Unit 5: Introduction to Error Handling in Rust
- Refactoring Error Handling in a Banking Application
- Enhancing Error Handling with Result and the Question Mark Operator in Rust