MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / from

Method from

atomic-repository/src/apply/types.rs:71–90  ·  view source on GitHub ↗
(e: LocalApplyError)

Source from the content-addressed store, hash-verified

69
70impl From<LocalApplyError> for InsertError {
71 fn from(e: LocalApplyError) -> Self {
72 match e {
73 LocalApplyError::DependencyMissing { hash } => InsertError::MissingDependencies {
74 missing: vec![hash],
75 },
76 LocalApplyError::ChangeAlreadyApplied { hash } => InsertError::AlreadyApplied {
77 hash: hash.to_base32(),
78 },
79 LocalApplyError::CyclicDependency { message } => {
80 InsertError::CyclicDependency { message }
81 }
82 LocalApplyError::InvalidChange => InsertError::InvalidChange {
83 message: "Change format is invalid".to_string(),
84 },
85 LocalApplyError::Corruption => InsertError::InvalidChange {
86 message: "Change data is corrupted".to_string(),
87 },
88 other => InsertError::Internal(other.to_string()),
89 }
90 }
91}
92
93/// Format a list of hashes for display.

Callers

nothing calls this directly

Calls 1

to_base32Method · 0.45

Tested by

no test coverage detected