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

Function truncate_chars

atomic-cli/src/commands/vault/context.rs:771–773  ·  view source on GitHub ↗

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

(s: &str, max_chars: usize)

Source from the content-addressed store, hash-verified

769
770/// Truncate to at most `max_chars` characters on a char boundary.
771fn truncate_chars(s: &str, max_chars: usize) -> String {
772 s.chars().take(max_chars).collect()
773}
774
775// Rendering
776

Callers 3

seed_from_intentMethod · 0.85
apply_budgetFunction · 0.85
previewFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected