rust-2024-migration
Guides users through migrating to Rust 2024 edition features including let chains, async closures, and improved match ergonomics. Activates when users work with Rust 2024 features or nested control flow.
Best use case
rust-2024-migration is best used when you need a repeatable AI agent workflow instead of a one-off prompt. It is especially useful for teams working in multi. Guides users through migrating to Rust 2024 edition features including let chains, async closures, and improved match ergonomics. Activates when users work with Rust 2024 features or nested control flow.
Guides users through migrating to Rust 2024 edition features including let chains, async closures, and improved match ergonomics. Activates when users work with Rust 2024 features or nested control flow.
Users should expect a more consistent workflow output, faster repeated execution, and less time spent rewriting prompts from scratch.
Practical example
Example input
Use the "rust-2024-migration" skill to help with this workflow task. Context: Guides users through migrating to Rust 2024 edition features including let chains, async closures, and improved match ergonomics. Activates when users work with Rust 2024 features or nested control flow.
Example output
A structured workflow result with clearer steps, more consistent formatting, and an output that is easier to reuse in the next run.
When to use this skill
- Use this skill when you want a reusable workflow rather than writing the same prompt again and again.
When not to use this skill
- Do not use this when you only need a one-off answer and do not need a reusable workflow.
- Do not use it if you cannot install or maintain the related files, repository context, or supporting tools.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/rust-2024-migration/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How rust-2024-migration Compares
| Feature / Agent | rust-2024-migration | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Guides users through migrating to Rust 2024 edition features including let chains, async closures, and improved match ergonomics. Activates when users work with Rust 2024 features or nested control flow.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Rust 2024 Migration Skill
You are an expert at modern Rust patterns from the 2024 edition. When you detect code that could use Rust 2024 features, proactively suggest migrations and improvements.
## When to Activate
Activate when you notice:
- Nested if-let expressions
- Manual async closures with cloning
- Cargo.toml with edition = "2021" or earlier
- Code patterns that could benefit from Rust 2024 features
## Rust 2024 Feature Patterns
### 1. Let Chains (Stabilized in 1.88.0)
**What to Look For**: Nested if-let or match expressions
**Before (Nested)**:
```rust
// ❌ Deeply nested, hard to read
fn process_user(id: &str) -> Option<String> {
if let Some(user) = db.find_user(id) {
if let Some(profile) = user.profile {
if profile.is_active {
if let Some(email) = profile.email {
return Some(email);
}
}
}
}
None
}
```
**After (Let Chains)**:
```rust
// ✅ Flat, readable chain
fn process_user(id: &str) -> Option<String> {
if let Some(user) = db.find_user(id)
&& let Some(profile) = user.profile
&& profile.is_active
&& let Some(email) = profile.email
{
Some(email)
} else {
None
}
}
```
**Suggestion Template**:
```
Your nested if-let can be flattened using let chains (Rust 2024):
if let Some(user) = get_user(id)
&& let Some(profile) = user.profile
&& profile.is_active
{
// All conditions met
}
This requires Rust 1.88+ and edition = "2024" in Cargo.toml.
```
### 2. Async Closures (Stabilized in 1.85.0)
**Before**:
```rust
// ❌ Manual async closure with cloning
let futures: Vec<_> = items
.iter()
.map(|item| {
let item = item.clone(); // Need to clone for async move
async move {
fetch_data(item).await
}
})
.collect();
```
**After**:
```rust
// ✅ Native async closure
let futures: Vec<_> = items
.iter()
.map(async |item| {
fetch_data(item).await
})
.collect();
```
### 3. Async Functions in Traits (Native since 1.75)
**Before**:
```rust
// ❌ OLD: Required async-trait crate
use async_trait::async_trait;
#[async_trait]
trait UserRepository {
async fn find_user(&self, id: &str) -> Result<User, Error>;
}
```
**After**:
```rust
// ✅ NEW: Native async fn in traits (Rust 1.75+)
trait UserRepository {
async fn find_user(&self, id: &str) -> Result<User, Error>;
}
impl UserRepository for PostgresRepo {
async fn find_user(&self, id: &str) -> Result<User, Error> {
self.db.query(id).await // No macro needed!
}
}
```
**When async-trait is Still Needed**:
```rust
// For dynamic dispatch (dyn Trait)
use async_trait::async_trait;
#[async_trait]
trait Plugin: Send + Sync {
async fn execute(&self) -> Result<(), Error>;
}
// This requires async-trait:
let plugins: Vec<Box<dyn Plugin>> = vec![
Box::new(PluginA),
Box::new(PluginB),
];
```
### 4. Match Ergonomics 2024
**Rust 2024 Changes**:
```rust
// Rust 2024: mut doesn't force by-value
match &data {
Some(mut x) => {
// x is &mut T (not T moved)
x.modify(); // Modifies through reference
}
None => {}
}
```
### 5. Gen Blocks (Stabilized in 1.85.0)
**Before (Manual Iterator)**:
```rust
struct RangeIter {
current: i32,
end: i32,
}
impl Iterator for RangeIter {
type Item = i32;
fn next(&mut self) -> Option<Self::Item> {
if self.current < self.end {
let result = self.current;
self.current += 1;
Some(result)
} else {
None
}
}
}
```
**After (Gen Block)**:
```rust
fn range_iter(start: i32, end: i32) -> impl Iterator<Item = i32> {
gen {
let mut current = start;
while current < end {
yield current;
current += 1;
}
}
}
```
## Migration Checklist
When migrating to Rust 2024:
1. **Update Cargo.toml**:
```toml
[package]
edition = "2024"
rust-version = "1.85" # Minimum version for Rust 2024
```
2. **Run cargo fix**:
```bash
cargo fix --edition
```
3. **Convert nested if-let to let chains**
4. **Remove async-trait where not needed** (keep for dyn Trait)
5. **Replace manual iterators with gen blocks**
6. **Use const functions where appropriate**
## Your Approach
When you see code patterns:
1. Identify nested control flow → suggest let chains
2. See async-trait → check if native async fn works
3. Manual iterators → suggest gen blocks
4. Async closures with cloning → suggest native syntax
Proactively suggest Rust 2024 patterns for more elegant, idiomatic code.Related Skills
ralph-tui-create-beads-rust
Convert PRDs to beads for ralph-tui execution using beads-rust (br CLI). Creates an epic with child beads for each user story. Use when you have a PRD and want to use ralph-tui with beads-rust as the task source. Triggers on: create beads, convert prd to beads, beads for ralph, ralph beads, br beads.
systems-programming-rust-project
You are a Rust project architecture expert specializing in scaffolding production-ready Rust applications. Generate complete project structures with cargo tooling, proper module organization, testing
rust-pro
Master Rust 1.75+ with modern async patterns, advanced type system features, and production-ready systems programming. Expert in the latest Rust ecosystem including Tokio, axum, and cutting-edge crates. Use PROACTIVELY for Rust development, performance optimization, or systems programming.
rust-async-patterns
Master Rust async programming with Tokio, async traits, error handling, and concurrent patterns. Use when building async Rust applications, implementing concurrent systems, or debugging async code.
godot-4-migration
Specialized guide for migrating Godot 3.x projects to Godot 4 (GDScript 2.0), covering syntax changes, Tweens, and exports.
framework-migration-legacy-modernize
Orchestrate a comprehensive legacy system modernization using the strangler fig pattern, enabling gradual replacement of outdated components while maintaining continuous business operations through ex
framework-migration-deps-upgrade
You are a dependency management expert specializing in safe, incremental upgrades of project dependencies. Plan and execute dependency updates with minimal risk, proper testing, and clear migration pa
framework-migration-code-migrate
You are a code migration expert specializing in transitioning codebases between frameworks, languages, versions, and platforms. Generate comprehensive migration plans, automated migration scripts, and
database-migrations-sql-migrations
SQL database migrations with zero-downtime strategies for PostgreSQL, MySQL, SQL Server
database-migrations-migration-observability
Migration monitoring, CDC, and observability infrastructure
azure-storage-blob-rust
Azure Blob Storage SDK for Rust. Use for uploading, downloading, and managing blobs and containers. Triggers: "blob storage rust", "BlobClient rust", "upload blob rust", "download blob rust", "container rust".
azure-keyvault-secrets-rust
Azure Key Vault Secrets SDK for Rust. Use for storing and retrieving secrets, passwords, and API keys. Triggers: "keyvault secrets rust", "SecretClient rust", "get secret rust", "set secret rust".