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

Function pad_left

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

Source from the content-addressed store, hash-verified

25}
26
27pub fn pad_left(text: &str, width: usize) -> String {
28 let text_width = text.width();
29 if text_width >= width {
30 return text.to_string();
31 }
32 format!("{}{}", " ".repeat(width - text_width), text)
33}
34
35pub fn pad_right(text: &str, width: usize) -> String {
36 let text_width = text.width();

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected