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

Function truncate_chars

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

730
731/// Truncate to at most `max_chars` characters on a char boundary.
732fn truncate_chars(s: &str, max_chars: usize) -> String {
733 s.chars().take(max_chars).collect()
734}
735
736// Rendering
737

Callers 3

seed_from_intentMethod · 0.85
apply_budgetFunction · 0.85
previewFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected