Remove serde (#23)

This commit is contained in:
Patrick Stevens
2023-06-05 20:55:23 +01:00
committed by GitHub
parent 8b5213e262
commit c3b7cdc725
8 changed files with 142 additions and 80 deletions

View File

@@ -8,4 +8,3 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
serde = { version = "1.0.163", features = [ "derive" ] }

View File

@@ -1,6 +1,5 @@
use serde::Serialize;
use std::fmt::{Debug, Formatter};
#[derive(Serialize)]
pub struct CoordinatePair {
pub x0: f64,
pub y0: f64,
@@ -8,7 +7,22 @@ pub struct CoordinatePair {
pub y1: f64,
}
#[derive(Serialize)]
impl Debug for CoordinatePair {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
f.write_fmt(format_args!(
"x0: {} ({:?}), y0: {} ({:?}), x1: {} ({:?}), y1: {} ({:?})",
self.x0,
self.x0.to_be_bytes(),
self.y0,
self.y0.to_be_bytes(),
self.x1,
self.x1.to_be_bytes(),
self.y1,
self.y1.to_be_bytes()
))
}
}
pub struct HaversineData {
pub pairs: Vec<CoordinatePair>,
}