Updating a Rust Project to Latest Dependencies
I recently updated an older Rust project (termdex, a terminal-based Pokédex) to use the latest package versions. Here’s what I ran into and how I fixed it.
The Starting Point
The project was using older versions of most dependencies:
ratatui0.26 (still namedtuiin Cargo.toml)diesel2.0.0crossterm0.26reqwest0.11- And several others
The goal was to get everything up to the latest stable versions while keeping the project functional.
Major Updates
Ratatui Migration
The biggest change was moving from ratatui 0.27 to 0.29. The library had several API changes:
- Frame generics:
Frame<B>became justFrame(no generic parameter) - Area method:
f.size()→f.area() - Cursor positioning:
f.set_cursor()→f.set_cursor_position()(takes a tuple now) - Text API:
Spanswas replaced withLine. Code likeText::from(Spans::from(...))becameText::from(vec![Line::from(...)]) - Wrap API:
Wrap { trim: true }works, butWrap::trim()doesn’t exist in 0.29
Diesel Macros
Diesel 2.1 deprecated the old #[table_name = "..."] syntax. I updated all models to use the new format:
// Old
#[table_name = "pokemon"]
pub struct NewPokemon { ... }
// New
#[diesel(table_name = pokemon)]
pub struct NewPokemon { ... }
Version Conflicts
The trickiest part was resolving version conflicts between dependencies:
tui-input0.8 usedcrossterm0.27, butratatui0.29 needscrossterm0.28- Solution: Updated
tui-inputto 0.14, which supportscrossterm0.28 ansi-to-tuihad similar issues—upgraded from 3.0 to 7.0 to matchratatui0.29
Docker Updates
The Dockerfiles needed Rust 1.86 to compile the latest diesel_cli (2.3.3). Updated both Dockerfiles from rust:1.82 to rust:1.86.
Common Issues
- Borrow checker: Had to clone
Textobjects before passing them to widgets when they’re used later - Unused variables: Some loops had
indexthat wasn’t used, but in one case it was actually needed for array indexing - Deprecated methods: Various method renames and API changes that required grep searches through the codebase
The Process
I used Cursor’s AI assistant to help with this. The workflow was:
- Update Cargo.toml with target versions
- Run
cargo buildto see errors - Fix compilation errors one by one
- Repeat until it builds
The AI was helpful for finding all the places that needed changes (like searching for f.size() or #[table_name), but you still need to understand the codebase structure to make the right fixes.
Final Result

After updating:
ratatui: 0.27 → 0.29crossterm: 0.27 → 0.28diesel: 2.0.0 → 2.1reqwest: 0.11 → 0.12tui-input: 0.8 → 0.14ansi-to-tui: 3.0 → 7.0
Everything compiles and works. The warnings about unused imports and results are still there, but those are non-blocking.
Takeaways
- Read the error messages carefully—they often point to exactly what needs changing
- Update in stages—don’t try to update everything at once
- Version conflicts are common—dependencies often have their own version requirements
- Keep Dockerfiles in sync—Rust version requirements can break builds
The whole process took a couple of hours, mostly spent fixing API changes and resolving version conflicts. The code is now on modern, maintained versions of all dependencies.