[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M72T9QMVP429BYG02CWASAXJ":3,"skill-same:01M72T9QMVP429BYG02CWASAXJ":50},{"skillNo":4,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":29,"commitSha":30,"skillDirectory":31,"forksCount":13,"repositoryHtmlUrl":32,"repositoryHomepageUrl":32,"ownerHtmlUrl":33,"ownerBlogUrl":6,"ownerDescription":34,"updatedAt":35,"install":36,"resources":49},"01M72T9QMVP429BYG02CWASAXJ","Rust",null,"iberi22\u002Fskills","iberi22","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F10615454?v=4","01M72SQ2NXAA3GW0FSH053A5ES","Brahyan Belalcazar","01M72SQ2PYCH0SSA1K61NGEHDV",0,"MIT","https:\u002F\u002Fgithub.com\u002Fiberi22\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Flanguage\u002Frust\u002FSKILL.md",[],[],"2026-11-10 22:39:42",false,"---\nid: rust\nname: Rust\ncategory: language\ntags:\n  - rust\ngoals:\n  - \"Write idiomatic Rust avoiding ownership pitfalls, lifetime confusion, and common borrow checker battles.\"\nauthors:\n  - Brahyan Belalcazar\n---\n\n## Quick Reference\n\n| Topic | File | Key Trap |\n|-------|------|----------|\n| Ownership & Borrowing | `ownership-borrowing.md` | Move semantics catch everyone |\n| Strings & Types | `types-strings.md` | `String` vs `&str`, UTF-8 indexing |\n| Errors & Iteration | `errors-iteration.md` | `unwrap()` in production, lazy iterators |\n| Concurrency & Memory | `concurrency-memory.md` | `Rc` not `Send`, `RefCell` panics |\n| Advanced Traps | `advanced-traps.md` | unsafe, macros, FFI, performance |\n\n---\n\n## Critical Traps (High-Frequency Failures)\n\n### Ownership — #1 Source of Compiler Errors\n- **Variable moved after use** — clone explicitly or borrow with `&`\n- **`for item in vec` moves vec** — use `&vec` or `.iter()` to borrow\n- **`String` moved into function** — pass `&str` for read-only access\n\n### Borrowing — The Borrow Checker Always Wins\n- **Can't have `&mut` and `&` simultaneously** — restructure or interior mutability\n- **Returning reference to local fails** — return owned value instead\n- **Mutable borrow through `&mut self` blocks all access** — split struct or `RefCell`\n\n### Lifetimes — When Compiler Can't Infer\n- **`'static` means CAN live forever, not DOES** — `String` is 'static capable\n- **Struct with reference needs `\u003C'a>`** — `struct Foo\u003C'a> { bar: &'a str }`\n- **Function returning ref must tie to input** — `fn get\u003C'a>(s: &'a str) -> &'a str`\n\n### Strings — UTF-8 Surprises\n- **`s[0]` doesn't compile** — use `.chars().nth(0)` or `.bytes()`\n- **`.len()` returns bytes, not chars** — use `.chars().count()`\n- **`s1 + &s2` moves s1** — use `format!(\"{}{}\", s1, s2)` to keep both\n\n### Error Handling — Production Code\n- **`unwrap()` panics** — use `?` or `match` in production\n- **`?` needs `Result`\u002F`Option` return type** — main needs `-> Result\u003C()>`\n- **`expect(\"context\")` > `unwrap()`** — shows why it panicked\n\n### Iterators — Lazy Evaluation\n- **`.iter()` borrows, `.into_iter()` moves** — choose carefully\n- **`.collect()` needs type** — `collect::\u003CVec\u003C_>>()` or typed binding\n- **Iterators are lazy** — nothing runs until consumed\n\n### Concurrency — Thread Safety\n- **`Rc` is NOT `Send`** — use `Arc` for threads\n- **`Mutex` lock returns guard** — auto-unlocks on drop, don't hold across await\n- **`RwLock` deadlock** — reader upgrading to writer blocks forever\n\n### Memory — Smart Pointers\n- **`RefCell` panics at runtime** — if borrow rules violated\n- **`Box` for recursive types** — compiler needs known size\n- **Avoid `Rc\u003CRefCell\u003CT>>` spaghetti** — rethink ownership\n\n---\n\n## Common Compiler Errors (NEW)\n\n| Error | Cause | Fix |\n|-------|-------|-----|\n| `value moved here` | Used after move | Clone or borrow |\n| `cannot borrow as mutable` | Already borrowed | Restructure or RefCell |\n| `missing lifetime specifier` | Ambiguous reference | Add `\u003C'a>` |\n| `the trait bound X is not satisfied` | Missing impl | Check trait bounds |\n| `type annotations needed` | Can't infer | Turbofish or explicit type |\n| `cannot move out of borrowed content` | Deref moves | Clone or pattern match |\n\n---\n\n## Cargo Traps (NEW)\n\n- **`cargo update` updates Cargo.lock, not Cargo.toml** — manual version bump needed\n- **Features are additive** — can't disable a feature a dependency enables\n- **`[dev-dependencies]` not in release binary** — but in tests\u002Fexamples\n- **`cargo build --release` much faster** — debug builds are slow intentionally","## Quick Reference\n\n| Topic | File | Key Trap |\n|-------|------|----------|\n| Ownership & Borrowing | `ownership-borrowing.md` | Move semantics catch everyone |\n| Strings & Types | `types-strings.md` | `String` vs `&str`, UTF-8 indexing |\n| Errors & Iteration | `errors-iteration.md` | `unwrap()` in production, lazy iterators |\n| Concurrency & Memory | `concurrency-memory.md` | `Rc` not `Send`, `RefCell` panics |\n| Advanced Traps | `advanced-traps.md` | unsafe, macros, FFI, performance |\n\n---\n\n## Critical Traps (High-Frequency Failures)\n\n### Ownership — #1 Source of Compiler Errors\n- **Variable moved after use** — clone explicitly or borrow with `&`\n- **`for item in vec` moves vec** — use `&vec` or `.iter()` to borrow\n- **`String` moved into function** — pass `&str` for read-only access\n\n### Borrowing — The Borrow Checker Always Wins\n- **Can't have `&mut` and `&` simultaneously** — restructure or interior mutability\n- **Returning reference to local fails** — return owned value instead\n- **Mutable borrow through `&mut self` blocks all access** — split struct or `RefCell`\n\n### Lifetimes — When Compiler Can't Infer\n- **`'static` means CAN live forever, not DOES** — `String` is 'static capable\n- **Struct with reference needs `\u003C'a>`** — `struct Foo\u003C'a> { bar: &'a str }`\n- **Function returning ref must tie to input** — `fn get\u003C'a>(s: &'a str) -> &'a str`\n\n### Strings — UTF-8 Surprises\n- **`s[0]` doesn't compile** — use `.chars().nth(0)` or `.bytes()`\n- **`.len()` returns bytes, not chars** — use `.chars().count()`\n- **`s1 + &s2` moves s1** — use `format!(\"{}{}\", s1, s2)` to keep both\n\n### Error Handling — Production Code\n- **`unwrap()` panics** — use `?` or `match` in production\n- **`?` needs `Result`\u002F`Option` return type** — main needs `-> Result\u003C()>`\n- **`expect(\"context\")` > `unwrap()`** — shows why it panicked\n\n### Iterators — Lazy Evaluation\n- **`.iter()` borrows, `.into_iter()` moves** — choose carefully\n- **`.collect()` needs type** — `collect::\u003CVec\u003C_>>()` or typed binding\n- **Iterators are lazy** — nothing runs until consumed\n\n### Concurrency — Thread Safety\n- **`Rc` is NOT `Send`** — use `Arc` for threads\n- **`Mutex` lock returns guard** — auto-unlocks on drop, don't hold across await\n- **`RwLock` deadlock** — reader upgrading to writer blocks forever\n\n### Memory — Smart Pointers\n- **`RefCell` panics at runtime** — if borrow rules violated\n- **`Box` for recursive types** — compiler needs known size\n- **Avoid `Rc\u003CRefCell\u003CT>>` spaghetti** — rethink ownership\n\n---\n\n## Common Compiler Errors (NEW)\n\n| Error | Cause | Fix |\n|-------|-------|-----|\n| `value moved here` | Used after move | Clone or borrow |\n| `cannot borrow as mutable` | Already borrowed | Restructure or RefCell |\n| `missing lifetime specifier` | Ambiguous reference | Add `\u003C'a>` |\n| `the trait bound X is not satisfied` | Missing impl | Check trait bounds |\n| `type annotations needed` | Can't infer | Turbofish or explicit type |\n| `cannot move out of borrowed content` | Deref moves | Clone or pattern match |\n\n---\n\n## Cargo Traps (NEW)\n\n- **`cargo update` updates Cargo.lock, not Cargo.toml** — manual version bump needed\n- **Features are additive** — can't disable a feature a dependency enables\n- **`[dev-dependencies]` not in release binary** — but in tests\u002Fexamples\n- **`cargo build --release` much faster** — debug builds are slow intentionally",{"id":23,"name":5,"tags":24,"goals":25,"authors":27,"category":28},"rust",[23],[26],"Write idiomatic Rust avoiding ownership pitfalls, lifetime confusion, and common borrow checker battles.",[11],"language","main","688810f2886d212632acf81e532b24e483dd8b98","skills\u002Flanguage\u002Frust","https:\u002F\u002Fgithub.com\u002Fiberi22\u002Fskills","https:\u002F\u002Fgithub.com\u002Fiberi22","Senior WEB Full-Stack","2026-10-12 02:46:21",{"source":7,"skillName":5,"commands":37,"prompt":47,"zipAvailable":48},[38,41,44],{"tool":39,"command":40},"npx","npx skills add iberi22\u002Fskills --skill Rust",{"tool":42,"command":43},"bunx","bunx skills add iberi22\u002Fskills --skill Rust",{"tool":45,"command":46},"pnpm","pnpm dlx skills add iberi22\u002Fskills --skill Rust","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fiberi22\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Flanguage\u002Frust\u002FSKILL.md",true,[],[51,57,64,70,76,82],{"skillNo":52,"name":53,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":54,"categories":55,"keywords":56,"publishedAt":18},"01M72TWQEQD46ZC9TRBAABF78P","web-design-guidelines","https:\u002F\u002Fgithub.com\u002Fiberi22\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fweb\u002Fweb-design-guidelines\u002FSKILL.md",[],[],{"skillNo":58,"name":59,"nameZh":6,"description":60,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":61,"categories":62,"keywords":63,"publishedAt":18},"01M72TWMQFTYD08DGXVAXRPPEB","blocked-page-recovery","Use when a fetch fails: 403\u002F429, paywall, WAF, bot wall. Recovers the page via archives and provenance-checked fallbacks.","https:\u002F\u002Fgithub.com\u002Fiberi22\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fweb\u002Fblocked-page-recovery\u002FSKILL.md",[],[],{"skillNo":65,"name":66,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":18},"01M72TVQMS3HCTX18C8T97WTQQ","studio-coach","https:\u002F\u002Fgithub.com\u002Fiberi22\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Ftools\u002Fstudio-coach\u002FSKILL.md",[],[],{"skillNo":71,"name":72,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":18},"01M72TVNA2PR9RZW0ZAXYP1G6J","src-generator","https:\u002F\u002Fgithub.com\u002Fiberi22\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Ftools\u002Fsrc-generator\u002FSKILL.md",[],[],{"skillNo":77,"name":78,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":18},"01M72TVEJHHB6SAT3R3TY9MJKS","sqlite-pro","https:\u002F\u002Fgithub.com\u002Fiberi22\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Ftools\u002Fsqlite-pro\u002FSKILL.md",[],[],{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":18},"01M72TVC2EVBHQHCX96VTTYKB8","rigor-evaluator","Use when you need a quick heuristic rigor score (10 criteria, 0-2 each) for the features in a .gitcore\u002Ffeatures.json file, to decide which features are ready to ship.","https:\u002F\u002Fgithub.com\u002Fiberi22\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Ftools\u002Frigor-evaluator\u002FSKILL.md",[],[]]