Decode a Span from 24 bytes.
(bytes: &[u8; 24])
| 238 | |
| 239 | /// Decode a Span from 24 bytes. |
| 240 | fn vertex_from_bytes(bytes: &[u8; 24]) -> GraphNode<NodeId> { |
| 241 | let change = NodeId(L64::from_le_bytes([ |
| 242 | bytes[0], bytes[1], bytes[2], bytes[3], bytes[4], bytes[5], bytes[6], bytes[7], |
| 243 | ])); |
| 244 | let start = ChangePosition(L64::from_le_bytes([ |
| 245 | bytes[8], bytes[9], bytes[10], bytes[11], bytes[12], bytes[13], bytes[14], bytes[15], |
| 246 | ])); |
| 247 | let end = ChangePosition(L64::from_le_bytes([ |
| 248 | bytes[16], bytes[17], bytes[18], bytes[19], bytes[20], bytes[21], bytes[22], bytes[23], |
| 249 | ])); |
| 250 | GraphNode { change, start, end } |
| 251 | } |
| 252 | |
| 253 | #[test] |
| 254 | fn test_vertex_bytes_roundtrip() { |
no test coverage detected