Fix builder requiring fields that are optional/have defaults

This commit is contained in:
Paul van Tilburg 2022-09-29 19:53:07 +02:00
parent 11412a7ff9
commit f64e8d99cd
Signed by: paul
GPG Key ID: C6DE073EDA9EEC4D
1 changed files with 3 additions and 2 deletions

View File

@ -83,15 +83,16 @@ pub enum ParseError {
#[derive(Builder, Copy, Clone, Debug, Default)]
pub struct GeoUri {
/// The coordinate reference system used by the coordinates of this URI.
#[builder(default)]
pub crs_id: CrsId,
/// The latitude coordinate of a location.
pub latitude: f64,
/// The longitude coordinate of a location.
pub longitude: f64,
/// The altitude coordinate of a location, if provided.
#[builder(setter(strip_option))]
#[builder(default, setter(strip_option))]
pub altitude: Option<f64>,
#[builder(setter(strip_option))]
#[builder(default, setter(strip_option))]
/// The uncertainty around the location as a radius (distance) in meters.
pub uncertainty: Option<u32>,
}