Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Geometry enum and GeometryCollection #410

Merged
merged 6 commits into from
Mar 1, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use TryInto in deprecation notices
  • Loading branch information
urschrei committed Mar 1, 2020
commit 5c9c409f4d7b0d93bfb42ee5e3213b2655a951f2
14 changes: 7 additions & 7 deletions geo-types/src/geometry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ impl<T: CoordinateType> Geometry<T> {
/// assert_eq!(p2, Point::new(0., 0.,));
/// ```
#[deprecated(
note = "Will be removed in an upcoming version. Switch to std::convert::TryFrom<Point>"
note = "Will be removed in an upcoming version. Switch to std::convert::TryInto<Point>"
)]
pub fn into_point(self) -> Option<Point<T>> {
if let Geometry::Point(x) = self {
Expand All @@ -98,7 +98,7 @@ impl<T: CoordinateType> Geometry<T> {

/// If this Geometry is a LineString, then return that LineString, else None.
#[deprecated(
note = "Will be removed in an upcoming version. Switch to std::convert::TryFrom<LineString>"
note = "Will be removed in an upcoming version. Switch to std::convert::TryInto<LineString>"
)]
pub fn into_line_string(self) -> Option<LineString<T>> {
if let Geometry::LineString(x) = self {
Expand All @@ -110,7 +110,7 @@ impl<T: CoordinateType> Geometry<T> {

/// If this Geometry is a Line, then return that Line, else None.
#[deprecated(
note = "Will be removed in an upcoming version. Switch to std::convert::TryFrom<Line>"
note = "Will be removed in an upcoming version. Switch to std::convert::TryInto<Line>"
)]
pub fn into_line(self) -> Option<Line<T>> {
if let Geometry::Line(x) = self {
Expand All @@ -122,7 +122,7 @@ impl<T: CoordinateType> Geometry<T> {

/// If this Geometry is a Polygon, then return that, else None.
#[deprecated(
note = "Will be removed in an upcoming version. Switch to std::convert::TryFrom<Polygon>"
note = "Will be removed in an upcoming version. Switch to std::convert::TryInto<Polygon>"
)]
pub fn into_polygon(self) -> Option<Polygon<T>> {
if let Geometry::Polygon(x) = self {
Expand All @@ -134,7 +134,7 @@ impl<T: CoordinateType> Geometry<T> {

/// If this Geometry is a MultiPoint, then return that, else None.
#[deprecated(
note = "Will be removed in an upcoming version. Switch to std::convert::TryFrom<MultiPoint>"
note = "Will be removed in an upcoming version. Switch to std::convert::TryInto<MultiPoint>"
)]
pub fn into_multi_point(self) -> Option<MultiPoint<T>> {
if let Geometry::MultiPoint(x) = self {
Expand All @@ -146,7 +146,7 @@ impl<T: CoordinateType> Geometry<T> {

/// If this Geometry is a MultiLineString, then return that, else None.
#[deprecated(
note = "Will be removed in an upcoming version. Switch to std::convert::TryFrom<MultiLineString>"
note = "Will be removed in an upcoming version. Switch to std::convert::TryInto<MultiLineString>"
)]
pub fn into_multi_line_string(self) -> Option<MultiLineString<T>> {
if let Geometry::MultiLineString(x) = self {
Expand All @@ -158,7 +158,7 @@ impl<T: CoordinateType> Geometry<T> {

/// If this Geometry is a MultiPolygon, then return that, else None.
#[deprecated(
note = "Will be removed in an upcoming version. Switch to std::convert::TryFrom<MultiPolygon>"
note = "Will be removed in an upcoming version. Switch to std::convert::TryInto<MultiPolygon>"
)]
pub fn into_multi_polygon(self) -> Option<MultiPolygon<T>> {
if let Geometry::MultiPolygon(x) = self {
Expand Down