(text: &str, width: usize)
| 25 | } |
| 26 | |
| 27 | pub 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 | |
| 35 | pub fn pad_right(text: &str, width: usize) -> String { |
| 36 | let text_width = text.width(); |
nothing calls this directly
no outgoing calls
no test coverage detected