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

Function truncate_chars

atomic-cli/src/commands/vault/context.rs:786–788  ·  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

784
785/// Truncate to at most `max_chars` characters on a char boundary.
786fn truncate_chars(s: &str, max_chars: usize) -> String {
787 s.chars().take(max_chars).collect()
788}
789
790// Rendering
791

Callers 3

seed_from_intentMethod · 0.70
apply_budgetFunction · 0.70
previewFunction · 0.70

Calls 1

collectMethod · 0.45

Tested by

no test coverage detected