MCPcopy Create free account
hub / github.com/cel-rust/cel-rust / format_int

Function format_int

cel/src/duration.rs:197–210  ·  view source on GitHub ↗
(buf: &mut [u8], mut v: u64)

Source from the content-addressed store, hash-verified

195}
196
197fn format_int(buf: &mut [u8], mut v: u64) -> usize {
198 let mut w = buf.len();
199 if v == 0 {
200 w -= 1;
201 buf[w] = b'0';
202 } else {
203 while v > 0 {
204 w -= 1;
205 buf[w] = (v % 10) as u8 + b'0';
206 v /= 10;
207 }
208 }
209 w
210}
211
212#[cfg(test)]
213mod tests {

Callers 1

format_durationFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected