From 57d5025d12230fef4198432ed711c5e65f5bcbcd Mon Sep 17 00:00:00 2001 From: Yuri Astrakhan Date: Wed, 23 Feb 2022 11:11:37 -0500 Subject: [PATCH] Add `Default` trait constraint to CoordinateType This is an alternative, simpler take on https://github.com/georust/proj/pull/110 Adding default constraint allows https://github.com/georust/geo/pull/751 --- src/proj.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/proj.rs b/src/proj.rs index fe529292..a2ec3b05 100644 --- a/src/proj.rs +++ b/src/proj.rs @@ -27,8 +27,9 @@ use std::mem::MaybeUninit; use std::path::Path; use thiserror::Error; -pub trait CoordinateType: Float + Copy + PartialOrd + Debug {} -impl CoordinateType for T {} +/// Base numeric type. This should match CoordFloat trait in the geo-types crate. +pub trait CoordinateType: Float + Copy + PartialOrd + Debug + Default {} +impl CoordinateType for T {} /// An error number returned from a PROJ call. pub(crate) struct Errno(pub libc::c_int);