MCPcopy Create free account
hub / github.com/dylan-sutton-chavez/edge-python / pad_aligned

Function pad_aligned

compiler/src/modules/vm/handlers/format.rs:355–361  ·  view source on GitHub ↗
(s: &Spec, body: &str, sign_prefix_len: usize)

Source from the content-addressed store, hash-verified

353}
354
355fn pad_aligned(s: &Spec, body: &str, sign_prefix_len: usize) -> String {
356 let len = body.chars().count();
357 if len >= s.width { return body.to_string(); }
358 let pad = s.width - len;
359 let align = s.align.unwrap_or(b'>');
360 pad_with(body, pad, align, s.fill, sign_prefix_len)
361}
362
363fn pad_with(body: &str, pad: usize, align: u8, fill: char, sign_prefix_len: usize) -> String {
364 let mut out = String::new();

Callers 5

format_percentFunction · 0.85
format_charFunction · 0.85
format_intFunction · 0.85
format_floatFunction · 0.85
pad_numericFunction · 0.85

Calls 2

pad_withFunction · 0.85
countMethod · 0.80

Tested by

no test coverage detected