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

Method new

atomic-core/src/change/session.rs:103–119  ·  view source on GitHub ↗

Build deterministic refusal details, removing empty and duplicate paths.

(
        reason: impl Into<String>,
        paths: impl IntoIterator<Item = String>,
        recovery_ref: impl Into<String>,
        origin: SessionIncompleteOrigin,
    )

Source from the content-addressed store, hash-verified

101impl IncompleteSession {
102 /// Build deterministic refusal details, removing empty and duplicate paths.
103 pub fn new(
104 reason: impl Into<String>,
105 paths: impl IntoIterator<Item = String>,
106 recovery_ref: impl Into<String>,
107 origin: SessionIncompleteOrigin,
108 ) -> Self {
109 let mut paths: Vec<String> = paths.into_iter().filter(|path| !path.is_empty()).collect();
110 paths.sort();
111 paths.dedup();
112 Self {
113 reason: reason.into(),
114 paths,
115 recovery_ref: recovery_ref.into(),
116 origin,
117 unbound_commits: Vec::new(),
118 }
119 }
120
121 /// Attach observed-but-unbound commit identifiers to these refusal details.
122 ///

Callers

nothing calls this directly

Calls 4

sortMethod · 0.80
collectMethod · 0.45
into_iterMethod · 0.45
is_emptyMethod · 0.45

Tested by

no test coverage detected