MCPcopy Create free account
hub / github.com/ChrisFeldmeier/OpenCodeRust / pad_right

Function pad_right

crates/opencode-tui/src/ui/text.rs:35–41  ·  view source on GitHub ↗
(text: &str, width: usize)

Source from the content-addressed store, hash-verified

33}
34
35pub fn pad_right(text: &str, width: usize) -> String {
36 let text_width = text.width();
37 if text_width >= width {
38 return text.to_string();
39 }
40 format!("{}{}", text, " ".repeat(width - text_width))
41}
42
43pub fn center_text(text: &str, width: usize) -> String {
44 let text_width = text.width();

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected