Rust

From bighardperson/computer-science-skills-collection · View interactive version

Rust is an AI agent skill from the GitHub repository bighardperson/computer-science-skills-collection. Write idiomatic Rust avoiding ownership pitfalls, lifetime confusion, and common borrow checker battles.

How to use this skill

Skill file

Quick Reference

| Topic | File | Key Trap |

|-------|------|----------|

| Ownership & Borrowing | ownership-borrowing.md | Move semantics catch everyone |

| Strings & Types | types-strings.md | String vs &str, UTF-8 indexing |

| Errors & Iteration | errors-iteration.md | unwrap() in production, lazy iterators |

| Concurrency & Memory | concurrency-memory.md | Rc not Send, RefCell panics |

| Advanced Traps | advanced-traps.md | unsafe, macros, FFI, performance |


Critical Traps (High-Frequency Failures)

Ownership — #1 Source of Compiler Errors

Borrowing — The Borrow Checker Always Wins

Lifetimes — When Compiler Can't Infer

Strings — UTF-8 Surprises

Error Handling — Production Code

Iterators — Lazy Evaluation

Concurrency — Thread Safety

Memory — Smart Pointers


Common Compiler Errors (NEW)

| Error | Cause | Fix |

|-------|-------|-----|

| value moved here | Used after move | Clone or borrow |

| cannot borrow as mutable | Already borrowed | Restructure or RefCell |

| missing lifetime specifier | Ambiguous reference | Add <'a> |

| the trait bound X is not satisfied | Missing impl | Check trait bounds |

| type annotations needed | Can't infer | Turbofish or explicit type |

| cannot move out of borrowed content | Deref moves | Clone or pattern match |


Cargo Traps (NEW)

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.