Skip to main content

normalize_debug_snapshot

Function normalize_debug_snapshot 

Source
pub fn normalize_debug_snapshot(value: &dyn Debug) -> (String, Vec<ObjectId>)
Expand description

Normalize debug-formatted value so one snapshot can be reused for SHA-1 and SHA-256 fixtures.

The helper rewrites 40- and 64-character hexadecimal object IDs to stable Oid(<n>) placeholders in first-seen order while leaving the surrounding pretty-debug formatting untouched. Debug wrappers like Sha1(<hex>) and Sha256(<hex>) are collapsed to the same placeholder. It also returns the replaced object IDs in first-seen order, so Oid(n) can be looked up as result.1[n - 1].