geocoords 0.1.0

A Coordinates struct that is opinionated in that it strictly represents valid latitude and longitude. Represented internally as 64-bit floating points; this provides sub-millimeter precision anywhere on Earth.
Documentation
#[derive(Debug, thiserror::Error)]
pub enum ParseError {
	#[error("'{0}' is not a valid coordinate format")]
	InvalidFormat(String),
	#[error("Failed to parse float: {0}")]
	InvalidFloat(#[from] std::num::ParseFloatError),
	#[error("{0}")]
	LatitudeOutOfRange(#[from] LatitudeOutOfRange),
	#[error("{0}")]
	LongitudeOutOfRange(#[from] LongitudeOutOfRange)
}

impl From<OutOfRange> for ParseError {
	fn from(inner: OutOfRange) -> Self {
		match inner {
			OutOfRange::Latitude(e) => Self::LatitudeOutOfRange(e),
			OutOfRange::Longitude(e) => Self::LongitudeOutOfRange(e)
		}
	}
}

#[derive(Debug, thiserror::Error)]
pub enum OutOfRange {
	#[error("{0}")]
	Latitude(#[from] LatitudeOutOfRange),
	#[error("{0}")]
	Longitude(#[from] LongitudeOutOfRange)
}

#[derive(Debug, thiserror::Error)]
#[error("{0} is not in valid latitude range; must be between -90 and 90")]
pub struct LatitudeOutOfRange(pub f64);

#[derive(Debug, thiserror::Error)]
#[error("{0} is not in valid longitude range; must be between -180 and 180")]
pub struct LongitudeOutOfRange(pub f64);