Menu

Comparing ea93dd6aa4...cf6845b0e9 · r/morph
📰
0

Comparing ea93dd6aa4...cf6845b0e9 · r/morph

GitHub·r·about 1 month ago
#WrbRBZW2
Reading 0:00
15s threshold

Commits on May 2, 2026 refactor(hash): Hash::from_hex error carries the input; drop 18 map_e… …rr chains Phase D of the cleanup sweep. Hash::from_hex used to bubble the underlying hex parser's complaint ("Invalid character at position 0", "expected 32 bytes") inside MorphError::InvalidHash. That message is useless to an operator — the operator wants to know *which string* failed to parse so they can compare it against what they typed. So 18 call sites across forget.rs, store.rs (×7), commit.rs (×6), extract.rs, migrate.rs, ssh_store.rs (×4), objmerge.rs (×3), merge_state.rs, treemerge.rs, tap.rs, and morph-serve/src/service.rs all wrapped with Hash::from_hex(s).map_err(|_| MorphError::InvalidHash(s.into())) to swap the parser error for the input. Every wrap was the same shape; the same boilerplate appeared at every place a hex string crosses a "should be a hash" boundary. Now Hash::from_hex itself puts the input string in MorphError::InvalidHash, and all 18 call sites collapse to plain `?`.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More