MCPcopy Create free account
hub / github.com/davidblewett/rure-python / vb

Function vb

regex/src/dfa.rs:1832–1841  ·  view source on GitHub ↗

Helper function for formatting a byte as a nice-to-read escaped string.

(b: usize)

Source from the content-addressed store, hash-verified

1830
1831/// Helper function for formatting a byte as a nice-to-read escaped string.
1832fn vb(b: usize) -> String {
1833 use std::ascii::escape_default;
1834
1835 if b > ::std::u8::MAX as usize {
1836 "EOF".to_owned()
1837 } else {
1838 let escaped = escape_default(b as u8).collect::<Vec<u8>>();
1839 String::from_utf8_lossy(&escaped).into_owned()
1840 }
1841}
1842
1843fn usize_to_u32(n: usize) -> u32 {
1844 if (n as u64) > (::std::u32::MAX as u64) {

Callers 1

fmtMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected