(bytes: &[u8])
| 410 | /// Minimal hex encoding for trace/span IDs (avoids adding `hex` crate). |
| 411 | mod hex { |
| 412 | pub fn encode(bytes: &[u8]) -> String { |
| 413 | let mut s = String::with_capacity(bytes.len() * 2); |
| 414 | for &b in bytes { |
| 415 | s.push(HEX_CHARS[(b >> 4) as usize]); |
| 416 | s.push(HEX_CHARS[(b & 0xf) as usize]); |
| 417 | } |
| 418 | s |
| 419 | } |
| 420 | const HEX_CHARS: [char; 16] = [ |
| 421 | '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f', |
| 422 | ]; |
no test coverage detected