Skip to content

Commit

Permalink
Use TryInto in deprecation notices
Browse files Browse the repository at this point in the history
  • Loading branch information
urschrei committed Mar 1, 2020
1 parent ab8cd63 commit e8ce54c
Showing 1 changed file with 7 additions and 7 deletions.
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

0 comments on commit e8ce54c

Please sign in to comment.