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

Function truncate_chars

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

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

Callers 3

seed_from_intentMethod · 0.85
apply_budgetFunction · 0.85
previewFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected