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

Function truncate_chars

libatomic/src/daemon/services_agent.rs:330–332  ·  view source on GitHub ↗

Truncate to at most `max_chars` characters on a char boundary.

(value: &str, max_chars: usize)

Source from the content-addressed store, hash-verified

328
329 /// Truncate to at most `max_chars` characters on a char boundary.
330 fn truncate_chars(value: &str, max_chars: usize) -> String {
331 value.chars().take(max_chars).collect()
332 }
333
334 /// One-line preview of a body (first 160 chars, newlines collapsed).
335 fn preview(body: &str) -> String {

Callers 3

previewFunction · 0.70
seed_from_intentFunction · 0.70
apply_budgetFunction · 0.70

Calls 1

collectMethod · 0.45

Tested by

no test coverage detected