diff --git a/geo-types/src/lib.rs b/geo-types/src/lib.rs index 166e9a4a1..db9a6d28f 100644 --- a/geo-types/src/lib.rs +++ b/geo-types/src/lib.rs @@ -114,6 +114,7 @@ mod triangle; pub use crate::triangle::Triangle; mod rect; +#[allow(deprecated)] pub use crate::rect::{InvalidRectCoordinatesError, Rect}; #[macro_use] diff --git a/geo-types/src/rect.rs b/geo-types/src/rect.rs index 991be1274..041b7f3f6 100644 --- a/geo-types/src/rect.rs +++ b/geo-types/src/rect.rs @@ -85,6 +85,7 @@ impl Rect { since = "0.6.2", note = "Use `Rect::new` instead, since `Rect::try_new` will never Error" )] + #[allow(deprecated)] pub fn try_new(c1: C, c2: C) -> Result, InvalidRectCoordinatesError> where C: Into>, @@ -264,11 +265,17 @@ impl Rect { static RECT_INVALID_BOUNDS_ERROR: &str = "Failed to create Rect: 'min' coordinate's x/y value must be smaller or equal to the 'max' x/y value"; +#[deprecated( + since = "0.6.2", + note = "Use `Rect::new` instead, since `Rect::try_new` will never Error" +)] #[derive(Debug, Copy, Clone, PartialEq, Eq)] pub struct InvalidRectCoordinatesError; +#[allow(deprecated)] impl std::error::Error for InvalidRectCoordinatesError {} +#[allow(deprecated)] impl std::fmt::Display for InvalidRectCoordinatesError { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { write!(f, "{}", RECT_INVALID_BOUNDS_ERROR)