diff --git a/hex_assignments/src/footfall.rs b/hex_assignments/src/footfall.rs index bd9ece9e0..be092800e 100644 --- a/hex_assignments/src/footfall.rs +++ b/hex_assignments/src/footfall.rs @@ -9,16 +9,9 @@ pub struct Footfall { } impl Footfall { - pub fn new() -> Self { + pub fn new(footfall: Option) -> Self { Self { - footfall: None, - timestamp: None, - } - } - - pub fn new_mock(footfall: DiskTreeMap) -> Self { - Self { - footfall: Some(footfall), + footfall, timestamp: None, } } @@ -26,7 +19,7 @@ impl Footfall { impl Default for Footfall { fn default() -> Self { - Self::new() + Self::new(None) } } diff --git a/hex_assignments/src/landtype.rs b/hex_assignments/src/landtype.rs index 533bb6f21..29ba9b645 100644 --- a/hex_assignments/src/landtype.rs +++ b/hex_assignments/src/landtype.rs @@ -9,16 +9,9 @@ pub struct Landtype { } impl Landtype { - pub fn new() -> Self { + pub fn new(landtype: Option) -> Self { Self { - landtype: None, - timestamp: None, - } - } - - pub fn new_mock(landtype: DiskTreeMap) -> Self { - Self { - landtype: Some(landtype), + landtype, timestamp: None, } } @@ -26,7 +19,7 @@ impl Landtype { impl Default for Landtype { fn default() -> Self { - Self::new() + Self::new(None) } } diff --git a/hex_assignments/src/lib.rs b/hex_assignments/src/lib.rs index 20d15b2b3..da87d9e5d 100644 --- a/hex_assignments/src/lib.rs +++ b/hex_assignments/src/lib.rs @@ -214,9 +214,9 @@ mod tests { footfall.to_disktree(Cursor::new(&mut footfall_buff), |w, v| w.write_all(&[*v]))?; landtype.to_disktree(Cursor::new(&mut landtype_buf), |w, v| w.write_all(&[*v]))?; - let footfall = Footfall::new_mock(DiskTreeMap::with_buf(footfall_buff)?); - let landtype = Landtype::new_mock(DiskTreeMap::with_buf(landtype_buf)?); - let urbanization = Urbanization::new_mock(DiskTreeMap::with_buf(urbanized_buf)?); + let footfall = Footfall::new(Some(DiskTreeMap::with_buf(footfall_buff)?)); + let landtype = Landtype::new(Some(DiskTreeMap::with_buf(landtype_buf)?)); + let urbanization = Urbanization::new(Some(DiskTreeMap::with_buf(urbanized_buf)?)); // Let the testing commence let data = HexBoostData::builder() diff --git a/hex_assignments/src/urbanization.rs b/hex_assignments/src/urbanization.rs index c4a2c0943..2cc2ca79f 100644 --- a/hex_assignments/src/urbanization.rs +++ b/hex_assignments/src/urbanization.rs @@ -9,16 +9,9 @@ pub struct Urbanization { } impl Urbanization { - pub fn new() -> Self { + pub fn new(urbanized: Option) -> Self { Self { - urbanized: None, - timestamp: None, - } - } - - pub fn new_mock(urbanized: DiskTreeMap) -> Self { - Self { - urbanized: Some(urbanized), + urbanized, timestamp: None, } } @@ -26,7 +19,7 @@ impl Urbanization { impl Default for Urbanization { fn default() -> Self { - Self::new() + Self::new(None) } } diff --git a/mobile_verifier/src/boosting_oracles/data_sets.rs b/mobile_verifier/src/boosting_oracles/data_sets.rs index 2a3034383..e0065e055 100644 --- a/mobile_verifier/src/boosting_oracles/data_sets.rs +++ b/mobile_verifier/src/boosting_oracles/data_sets.rs @@ -262,9 +262,9 @@ impl DataSetDownloaderDaemon { .create() .await?; - let urbanization = Urbanization::new(); - let footfall = Footfall::new(); - let landtype = Landtype::new(); + let urbanization = Urbanization::new(None); + let footfall = Footfall::new(None); + let landtype = Landtype::new(None); let hex_boost_data = HexBoostData::builder() .footfall(footfall) .landtype(landtype)