MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / read_f64

Function read_f64

nodedb-spatial/src/wkb.rs:257–277  ·  view source on GitHub ↗
(data: &[u8], cursor: &mut usize, is_le: bool)

Source from the content-addressed store, hash-verified

255}
256
257fn read_f64(data: &[u8], cursor: &mut usize, is_le: bool) -> Option<f64> {
258 if *cursor + 8 > data.len() {
259 return None;
260 }
261 let bytes: [u8; 8] = [
262 data[*cursor],
263 data[*cursor + 1],
264 data[*cursor + 2],
265 data[*cursor + 3],
266 data[*cursor + 4],
267 data[*cursor + 5],
268 data[*cursor + 6],
269 data[*cursor + 7],
270 ];
271 *cursor += 8;
272 Some(if is_le {
273 f64::from_le_bytes(bytes)
274 } else {
275 f64::from_be_bytes(bytes)
276 })
277}
278
279fn read_coords(
280 data: &[u8],

Callers 2

read_geometryFunction · 0.70
read_coordsFunction · 0.70

Calls 1

lenMethod · 0.45

Tested by

no test coverage detected