Rust Learner

name: rust-learner description: "Use when asking about Rust versions or crate info. Keywords: latest version, what's new, changelog, Rust 1.x, Rust release, stable, nightly, crate info, crates.io, lib
阅读全文

Common Rust Anti-Patterns & Mistakes

Common Rust Anti-Patterns & Mistakes Ownership Anti-Patterns 1. Clone Everything // ANTI-PATTERN: clone to avoid borrow checker fn process(data: Vec<String>) { for item in data.clone() { //
阅读全文

Anti-Patterns

name: m15-anti-pattern description: "Use when reviewing code for anti-patterns. Keywords: anti-pattern, common mistake, pitfall, code smell, bad practice, code review, is this an anti-pattern, better
阅读全文

Thread-Based Concurrency Patterns

Thread-Based Concurrency Patterns Thread Spawning Best Practices Basic Thread Spawn use std::thread; fn main() { let handle = thread::spawn(|| { println!("Hello from thread!"); 42 // return value });
阅读全文

Async Patterns in Rust

Async Patterns in Rust Task Spawning Basic Spawn use tokio::task; #[tokio::main] async fn main() { // Spawn a task that runs concurrently let handle = task::spawn(async { expensive_computation().await
阅读全文

Common Concurrency Errors & Fixes

Common Concurrency Errors & Fixes E0277: Cannot Send Between Threads Error Pattern use std::rc::Rc; let data = Rc::new(42); std::thread::spawn(move || { println!("{}", data); // ERROR: Rc<i32&g
阅读全文

Concurrency

name: m07-concurrency description: "CRITICAL: Use for concurrency/async. Triggers: E0277 Send Sync, cannot be sent between threads, thread, spawn, channel, mpsc, Mutex, RwLock, Atomic, async, await, F
阅读全文

FinTech Domain

name: domain-fintech description: "Use when building fintech apps. Keywords: fintech, trading, decimal, currency, financial, money, transaction, ledger, payment, exchange rate, precision, rounding, ac
阅读全文

Complete Rules Reference

Complete Rules Reference For the full 500+ rules, see: Source: https://rust-coding-guidelines.github.io/rust-coding-guidelines-zh/ Core rules are in ../SKILL.md.
阅读全文