(s: &Spec, body: &str)
| 335 | } |
| 336 | |
| 337 | fn pad_numeric(s: &Spec, body: &str) -> String { |
| 338 | let (neg, mag) = if let Some(rest) = body.strip_prefix('-') { (true, rest) } else { (false, body) }; |
| 339 | let sign_ch = sign_char(neg, s.sign); |
| 340 | let mut left = String::new(); |
| 341 | if let Some(c) = sign_ch { left.push(c); } |
| 342 | left.push_str(mag); |
| 343 | pad_aligned(s, &left, sign_ch.map(|_| 1).unwrap_or(0)) |
| 344 | } |
| 345 | |
| 346 | fn pad_string(s: &Spec, body: &str) -> String { |
| 347 | let len = body.chars().count(); |
no test coverage detected