MCPcopy Create free account
hub / github.com/BillyDM/Firewheel / patch

Method patch

crates/firewheel-core/src/diff/collections.rs:51–59  ·  view source on GitHub ↗
(data: &ParamData, path: &[u32])

Source from the content-addressed store, hash-verified

49 type Patch = (usize, T::Patch);
50
51 fn patch(data: &ParamData, path: &[u32]) -> Result<Self::Patch, PatchError> {
52 let first = *path.first().ok_or(PatchError::InvalidPath)? as usize;
53 if first >= LEN {
54 return Err(PatchError::InvalidPath);
55 }
56 let inner = T::patch(data, &path[1..])?;
57
58 Ok((first, inner))
59 }
60
61 fn apply(&mut self, patch: Self::Patch) {
62 self[patch.0].apply(patch.1);

Callers

nothing calls this directly

Calls 1

firstMethod · 0.80

Tested by

no test coverage detected