דילוג לתוכן
New

DeepSeek V4.1 Flash free for 7 days: 10M tokens a day after a top-up of $10 or more. Until Nov 30.

How it works
aeondave/rust-patternsAPIs, SaaS וזהות

rust-patterns

⁨Idiomatic Rust patterns and best practices for readable, safe, maintainable Rust: ownership, borrowing, API design, enums/traits, error handling, iterators, concurrency, dynamic dispatch/plugins, and low-level/offensive patterns. Use when writing or reviewing `.rs` code, refactoring crates, porting ⁩

v2026.11.13-21cd5683 התקנות⁦+3⁩ ב-7 ימים39 כוכביםMITסונכרן לפני 10 שעות

התקנה

עדיין אין לכם את ה-CLI של NotHoly? התקינו אותו קודם.

$ curl -fsSL https://notholy.com/install.sh | sh
$ notholy skills install aeondave/rust-patterns

נכתב אל ⁦~/.notholy/skills⁩ אחרי בדיקת החתימה וה-SHA-256.

חתימהחתום, ed25519
zEMSCrATNW…Z9QthoAA==ה-CLI בודק את ה-SHA-256 ואת החתימה לפני שהוא כותב קובץ כלשהו.
חבילה029753b6…5e07b41e
029753b6499e…18f45e07b41e12 קבצים · ⁦27.0 KB⁩
סריקהבינוני3 ממצאים
  • injection.no_confirmationreferences/language.md:76
  • injection.no_confirmationreferences/security-review.md:62
  • קישורים לדומיינים חיצוניים
לסריקה המלאה
מקורgithub.com/AeonDave/malskill/tree/main/coding/rust-patterns@21cd568

הפריט הזה עדיין לא נכתב בעברית, ולכן הוא מוצג בשפה אחרת: English.

This skill is for day-to-day idiomatic Rust: clear ownership, small APIs, and code that feels native to the language instead of a direct port from somewhere else.

If the task is primarily profiling/benchmarking, use rust-performance. If the task is primarily test design or test repair, use rust-testing.

When to activate

  • Writing or refactoring .rs modules, libraries, CLIs, or services
  • Reviewing Rust PRs for ownership, borrowing, API shape, and common footguns
  • Porting code from C/C++/Go/Python into idiomatic Rust
  • Improving error handling, trait design, iterators, module boundaries, concurrency, or docs
  • Choosing a dispatch/plugin mechanism, or building low-level/offensive Rust with unsafe, FFI, or RE-resistant builds

Core rules (high signal)

  • Make ownership obvious in signatures: borrow by default, own when storing or crossing boundaries.
  • Model the domain with enums, newtypes, and builders instead of flag soup and loosely related primitives.
  • Use Result for fallible work; reserve panic!, unwrap, and expect for tests or truly impossible states.
  • Prefer iterators and pattern matching when they make intent clearer; do not turn readable logic into adapter golf.
  • Keep public APIs small and deliberate; re-export intentionally and hide implementation details.
  • Run cargo fmt and cargo clippy; style should not be negotiated by hand.
  • Treat crate edition as a semantic gate (capture rules, drop order, unsafe attributes, set_var). Do not assume the installed rustc edition.

Outcome expectations

  • Public APIs make ownership and failure behavior obvious at call sites.
  • Domain modeling uses enums/newtypes/builders instead of ad-hoc primitives.
  • Borrowing is preferred where practical; cloning is intentional and justified.
  • Tooling (fmt, clippy, test, docs) is part of the definition of done.

  1. Define API boundaries and ownership semantics in function signatures.
  2. Model states/errors with enums and typed results before implementing details.
  3. Implement with small focused functions and explicit visibility boundaries.
  4. Run cargo fmt, cargo clippy, and cargo test before review.
  5. Review for accidental clones, over-broad traits, and panic-prone paths.

Quick review checklist

  • No clone() used only to silence the borrow checker unless the clone is cheap and intentional
  • Inputs borrow where possible (&str, &[T], &Path, impl AsRef<Path>) instead of forcing ownership
  • Error paths preserve context and use ?; production code does not rely on stray unwrap
  • Enums beat boolean parameters; newtypes beat domain-significant bare integers/strings
  • Traits are small and consumer-oriented; generic signatures are useful, not ornamental
  • Module visibility is tidy (pub, pub(crate), private helpers, selective pub use)

Common anti-patterns to reject

  • clone() used only to “make borrow checker errors go away”
  • Public APIs that force ownership when a borrow would do
  • Boolean/flag parameter combinations that should be enums
  • Library code depending on routine unwrap/expect in operational paths
  • Large traits that couple unrelated behavior and block evolution

Platform and FFI boundaries

  • Keep platform-specific modules small and make them return the same public types as the shared path.
  • Prefer adapting one unstable primitive over forking a full protocol or workflow. Example shape: connect_with_timeout(...) -> io::Result<TcpStream> can use std::net normally and a Windows FFI helper only in a constrained build mode.
  • Use feature gates to remove incompatible definitions, not just unreachable call sites, when signatures or imports differ by build mode.
  • After adding Windows FFI bindings or windows-sys features, run a real target build; cargo check can pass before the linker sees missing imports or feature flags.
  • For raw-pointer, unsafe, uninitialized-memory, or ABI work, keep unsafe minimal behind a safe API and document invariants; load references/unsafe-and-ffi.md.
  • When auditing untrusted-input handling, unsafe soundness, or a dependency tree for security bugs, load references/security-review.md.

Resources

Load on demand:

  • references/language.md — load when using Edition 2024, async fn / RPITIT in traits, use<> capture, async closures / AsyncFn, let chains, if-let guards, #[expect], or edition-gated unsafe attributes
  • references/ownership-and-borrowing.md — use when signatures, lifetimes, moves, or borrow-checker friction are central
  • references/api-design.md — use when shaping public types, traits, builders, and module boundaries
  • references/errors-and-results.md — use when designing recoverable errors or cleaning up panic-prone code
  • references/collections-and-iterators.md — use when choosing collections or refactoring loops into clearer iterator code
  • references/tooling-and-docs.md — use when reviewing formatting, clippy, rustdoc, features, edition/rust-version, or crate hygiene
  • references/concurrency.md — use when choosing shared-state, channel, scoped threads, OnceLock/LazyLock, poison, or async callback patterns
  • references/dynamic-dispatch-and-plugins.md — use when choosing dyn vs generics vs enum dispatch, building plugin registries, loading code at runtime, or structuring command dispatchers
  • references/unsafe-and-ffi.md — use for unsafe blocks, raw pointers, provenance, uninitialized memory, repr(C)/ABI, or C FFI boundaries
  • references/offensive-lowlevel.md — use for RE-resistance, string obfuscation, memory protection, no_std entry points, inline asm/syscalls, or malware-style modular architecture
  • references/security-review.md — use when auditing Rust for security bugs: untrusted input, panics/DoS, integer overflow, secrets, or supply-chain risk

הקבצים בגרסה הזו

הרשאות

הרשאההוצהרנמצא בסריקה
קורא קבציםלאלא
כותב קבציםכןכן
מריץ פקודות shellכןכן
משתמש ברשתכןכן
משתמש במחבריםלאלא
שולט בדפדפןלאלא

ממצאי הסריקה

נבדק ב-13 בנוב׳ 2026

  1. בינוניתPrompt injection · injection.no_confirmationreferences/language.md:76
  2. בינוניתPrompt injection · injection.no_confirmationreferences/security-review.md:62
  3. מידעקישור · קישורים לדומיינים חיצוניים

סריקה נקייה מורידה את הסיכון, אבל לא מוכיחה שהחבילה בטוחה. כדאי לקרוא מה מתקינים.

גרסהפורסמהCommitSHA-256חתימהשינוי בהרשאות
v2026.11.13-21cd56813 בנוב׳ 202621cd568029753b6חתומה–

שאלו כל מה שהסקופ מאפשר.

יוצרים חשבון, מוסיפים קרדיטים ושואלים את השאלה הראשונה בצ׳אט או בטרמינל.

  1. 1/3

    יצירת חשבון

    פרטי או חברה. אפשר לעבור לחשבון חברה אחר כך בלי לאבד יתרה או מפתחות.

    פרטיחברה
  2. 2/3

    הוספת קרדיטים

    בכרטיס אשראי. תשלום לפי טוקן, בלי מנוי.

    $5.00טעינה מינימלית
  3. 3/3

    שאלה ראשונה

    בצ׳אט, או להתקין את ה-CLI ולהריץ notholy login בטרמינל.

    $ notholy login