Loading...
Loading...
This skill should be used when writing Rust code, using async closures, let chains, Edition 2024 features, new collection methods like extract_if, integer arithmetic methods, or any Rust features from 2024-2026.
npx skill4agent add nevaberry/nevaberry-plugins rust-knowledge-patch| Change | Migration |
|---|---|
| Add |
| Wrap unsafe attrs in |
| Explicit unsafe blocks required |
| Use atomics/sync primitives |
| Rename identifiers |
| Wrap in |
if let Some(x) = opt && x > 0 && let Some(y) = other { ... }references/edition-2024.mdasync || {}AsyncFnAsyncFnMutAsyncFnOnceOnceLock::waitRwLockWriteGuard::downgradereferences/async-and-concurrency.md| Method | Types |
|---|---|
| Vec, LinkedList, HashMap, HashSet, BTreeMap, BTreeSet |
| Vec |
| VecDeque |
| slices, HashMap |
| Cell |
(Vec<_>, Vec<_>) = iter.map(\|x\| (a, b)).collect()references/collections.md| Method | Description |
|---|---|
| Exact midpoint without overflow |
| Divisibility check |
| Return 0 on overflow |
| Bit reinterpretation |
| Subtract signed from unsigned |
| Panic on overflow (release too) |
| Extended precision arithmetic |
| UB on overflow (perf-critical) |
references/integers-and-arithmetic.mdas_chunksas_rchunks(&[[T; N]], &[T])slice.as_array::<N>()Option<&[T; N]>str.ceil_char_boundary(n)floor_char_boundary(n)reverserotate_leftrotate_rightreferences/slices-and-arrays.mdPath::file_prefixPathBuf::add_extensionOsStr::displayString::into_raw_parts(ptr, len, cap)references/strings-and-paths.md&dyn Derived&dyn BaseNonNullfrom_refwithout_provenanceexpose_provenanceMaybeUninitwrite_copy_of_sliceassume_init_refBox::new_zeroed()Arc::new_zeroed()references/pointers-and-memory.md#[target_feature]asm!asm!#[cfg(...)]#[unsafe(naked)]naked_asm!references/assembly-and-simd.mdio::pipe()File::lock/unlocki128/u128references/io-and-process.mdResult::flattenResult<Result<T,E>,E>Result<T,E>fmt::from_fnDuration::from_mins/hoursTypeId::offloorceilroundreferences/misc-apis.mdcargo publish --workspacereferences/cargo-and-tooling.mdreferences/| File | Contents |
|---|---|
| Full Edition 2024 migration guide |
| Async closures, locks, atomics |
| All integer methods |
| extract_if, pop_if, disjoint_mut |
| Chunking, conversion, const ops |
| Path/String APIs |
| Upcasting, provenance, MaybeUninit |
| asm!, target_feature, naked fns |
| Pipes, FFI, file locking |
| Floats, Duration, formatting, cfg |
| LLD, workspace publish, cache |