Lowercase hex for a tagged Git object ID (display only).
(bytes: &[u8])
| 1426 | |
| 1427 | /// Lowercase hex for a tagged Git object ID (display only). |
| 1428 | fn oid_hex(bytes: &[u8]) -> String { |
| 1429 | const HEX: &[u8; 16] = b"0123456789abcdef"; |
| 1430 | let mut out = String::with_capacity(bytes.len() * 2); |
| 1431 | for byte in bytes { |
| 1432 | out.push(HEX[(byte >> 4) as usize] as char); |
| 1433 | out.push(HEX[(byte & 0x0f) as usize] as char); |
| 1434 | } |
| 1435 | out |
| 1436 | } |
| 1437 | |
| 1438 | fn persist_checkout_event( |
| 1439 | root: &Path, |