mosaic-art-rust
mosaic-art-rust contient 7 skills collectées depuis naporin0624, avec une couverture métier par dépôt et des pages de détail sur le site.
Skills dans ce dépôt
Use when writing Rust that branches on an owned enum modeling state — TileStatus (NotStarted/InProgress/Completed) in the grid visualizer, a filled-vs-empty grid cell, a cache hit vs miss, or a simulated-annealing accept/reject decision — to choose behavior or a value, or when adding a variant to such an enum. Also when reaching for an if-let chain, a let-else, matches!, or a `_` wildcard arm to consume an enum this crate owns.
Use when composing or chaining Result values across the mosaic pipeline — sequencing image-load, decode, resize, and Lab-conversion steps (src/tile_cache.rs, src/similarity.rs); tempted by unwrap()/expect() on a missing material file or a corrupt similarity-cache JSON; discarding a save/load Result with let _ = ...; or deciding whether a failure becomes a CLI exit code (src/main.rs) or a rendered ProcessingState::Error (src/gui/app_full.rs).
Use when writing or modifying a Rust function with conditional branches — writing a per-tile or per-material loop that filters candidates, nesting a bounds check inside a usage-limit check, threading a `let mut best_match` through branches to return at the end, or wrapping a whole grid-loop body in a condition.
Use when converting between numeric types in this photomosaic generator, converting string↔number, or about to write `as` — u8 pixel channel ↔ f32 [0,1] color math, f32→u8 narrowing with clamp, usize↔u32 grid/tile index math, pixel counts (width * height) widened to f64 for averaging, or Lab/ΔE float math.
Use when authoring or converting Rust types in this photomosaic generator — defining a struct, enum, or function signature for grid cells, tile-placement outcomes, Lab colors, usage counts, adjacency penalties, or optimization config; typing several correlated fields as Option<T>; or about to reach for String, serde_json::Value, HashMap<String, String>, an over-permissive Vec<u8>, an `as` cast, or unwrap()/expect() to avoid modeling a value.
Use when branching on a file's extension or another string-token family with a growing match!/if-chain — e.g. supported material-image extensions "png"|"jpg"|"jpeg"|"webp" — especially when the same token-family test is duplicated across call sites (src/main.rs vs src/gui/app_full.rs) and has already drifted out of sync, or when adding several new format tokens to an existing check.
Use when naming or renaming a Rust function, method, struct, enum, trait, or module in this photomosaic crate — especially when a name is heading past three words (find_and_use_best_tile_with_position, process_tile_no_aspect_filter), contains and/or/with/if_missing (load_or_new), or describes several tile-selection or optimization steps at once.