MCPcopy Create free account
hub / github.com/concensure/Semantic / apply_patch

Method apply_patch

patch_engine/src/lib.rs:74–82  ·  view source on GitHub ↗
(existing_code: &str, patch: &CodePatch)

Source from the content-addressed store, hash-verified

72 }
73
74 pub fn apply_patch(existing_code: &str, patch: &CodePatch) -> Result<String> {
75 match &patch.representation {
76 PatchRepresentation::UnifiedDiff(diff) => apply_unified_diff(existing_code, diff),
77 PatchRepresentation::ASTTransform(ast_edit) => bail!(
78 "cannot apply abstract AST transform for '{}' without a concrete rewrite",
79 ast_edit.target_symbol
80 ),
81 }
82 }
83}
84
85fn apply_line_replacement(

Callers

nothing calls this directly

Calls 1

apply_unified_diffFunction · 0.85

Tested by

no test coverage detected