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

Function format_code_learning

atomic-agent/src/learnings.rs:200–221  ·  view source on GitHub ↗
(learning: &CodeLearning)

Source from the content-addressed store, hash-verified

198/// ```
199#[allow(dead_code)]
200fn format_code_learning(learning: &CodeLearning) -> String {
201 let mut s = learning.path.clone();
202
203 if let Some(line) = learning.line {
204 s.push_str(&format!(":{}", line));
205 if let Some(end) = learning.end_line {
206 s.push_str(&format!("-{}", end));
207 }
208 }
209
210 if let Some(ref func) = learning.function {
211 s.push_str(&format!(" ({})", func));
212 }
213
214 s.push_str(&format!(" — {}", learning.finding));
215
216 if let Some(ref category) = learning.category {
217 s.push_str(&format!(" [{}]", category));
218 }
219
220 s
221}
222
223// Read Existing Learnings
224

Callers

nothing calls this directly

Calls 1

cloneMethod · 0.45

Tested by

no test coverage detected