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

Use Point::from(c) instead of Point(c) #777

Merged
merged 1 commit into from
Mar 19, 2022
Merged

Conversation

nyurik
Copy link
Member

@nyurik nyurik commented Mar 17, 2022

Per discussion in #775, use the static from() instead of tuple ctor.

This will simplify migration to a different base type because type aliases do not support tuple instantiation.

Note that unlike the other similar PRs with ::new(v), this one uses the existing Point::from(v) fn because it directly assigns consumed values instead of converting them, and because it already has a Point::new(x, y)

  • I agree to follow the project's code of conduct.
  • [ ] I added an entry to CHANGES.md if knowledge of this change could be valuable to users.

bors bot added a commit that referenced this pull request Mar 17, 2022
779: Use `LineString::from()` instead of `LineString()` r=lnicola a=nyurik

Make migration simpler by using static function that will still be available if `LineString` becomes a type alias.

Similar to #777

- [x] I agree to follow the project's [code of conduct](https://github.com/georust/geo/blob/master/CODE_OF_CONDUCT.md).
- ~[ ] I added an entry to `CHANGES.md` if knowledge of this change could be valuable to users.~
---



Co-authored-by: Yuri Astrakhan <YuriAstrakhan@gmail.com>
@nyurik nyurik requested review from frewsxcv and rmanoka March 17, 2022 17:51
nyurik added a commit to nyurik/geo that referenced this pull request Mar 18, 2022
Make migration simpler by using static function that will still be available if `LineString` becomes a type alias.

Similar to georust#777

- [x] I agree to follow the project's [code of conduct](https://github.com/georust/geo/blob/master/CODE_OF_CONDUCT.md).
- ~[ ] I added an entry to `CHANGES.md` if knowledge of this change could be valuable to users.~
---
nyurik added a commit to nyurik/geo that referenced this pull request Mar 18, 2022
Make migration simpler by using static function that will still be available if `MultiPolygon` becomes a type alias.

Similar to georust#777
nyurik added a commit to nyurik/geo that referenced this pull request Mar 18, 2022
Make migration simpler by using static function that will still be available if `GeometryCollection` becomes a type alias.

Note that `GeometryCollection::new()` already exists, and is the same as ::default(). I couldn't find any usages of it.

I made `new()` deprecated, but the new method had to be something else - `new_from(val)`. Ideally, `new_from` should become `new(val)`

Similar to georust#777
nyurik added a commit to nyurik/geo that referenced this pull request Mar 18, 2022
Make migration simpler by using static function that will still be available if `GeometryCollection` becomes a type alias.

Note that `GeometryCollection::new()` already exists, and is the same as ::default(). I couldn't find any usages of it.

I made `new()` deprecated, but the new method had to be something else - `new_from(val)`. Ideally, `new_from` should become `new(val)`

Similar to georust#777
nyurik added a commit to nyurik/geo that referenced this pull request Mar 18, 2022
Make migration simpler by using static function that will still be available if `Triangle` becomes a type alias.

Similar to georust#777
nyurik added a commit to nyurik/geo that referenced this pull request Mar 18, 2022
Make migration simpler by using static function that will still be available if `MultiLineString` becomes a type alias.

Similar to georust#777
nyurik added a commit to nyurik/geo that referenced this pull request Mar 18, 2022
Make migration simpler by using static function that will still be available if `MultiLineString` becomes a type alias.

Similar to georust#777
nyurik added a commit to nyurik/geo that referenced this pull request Mar 18, 2022
Make migration simpler by using static function that will still be available if `MultiPoint` becomes a type alias.

Similar to georust#777
nyurik added a commit to nyurik/geo that referenced this pull request Mar 18, 2022
Make migration simpler by using static function that will still be available if `LineString` becomes a type alias.

Similar to georust#777
… ctor.

This will simplify migration to a different base type because type aliases do not support tuple instantiation.

Note that unlike the other similar PRs with `::new(v)`, this one uses the existing `Point::from(v)` fn because it directly assigns consumed values instead of converting them, and because it already has a `Point::new(x, y)`
bors bot added a commit that referenced this pull request Mar 19, 2022
781: Use `LineString::new()` instead of `LineString()` r=frewsxcv a=nyurik

Make migration simpler by using static function that will still be available if `LineString` becomes a type alias.

Similar to #777

- [x] I agree to follow the project's [code of conduct](https://github.com/georust/geo/blob/master/CODE_OF_CONDUCT.md).
- ~[ ] I added an entry to `CHANGES.md` if knowledge of this change could be valuable to users.~
---

Co-authored-by: Yuri Astrakhan <YuriAstrakhan@gmail.com>
nyurik added a commit to nyurik/geo that referenced this pull request Mar 19, 2022
Make migration simpler by using static function that will still be available if `MultiLineString` becomes a type alias.

Similar to georust#777
nyurik added a commit to nyurik/geo that referenced this pull request Mar 19, 2022
Make migration simpler by using static function that will still be available if `MultiPolygon` becomes a type alias.

Similar to georust#777
nyurik added a commit to nyurik/geo that referenced this pull request Mar 19, 2022
Make migration simpler by using static function that will still be available if `Triangle` becomes a type alias.

Similar to georust#777
nyurik added a commit to nyurik/geo that referenced this pull request Mar 19, 2022
Make migration simpler by using static function that will still be available if `GeometryCollection` becomes a type alias.

Note that `GeometryCollection::new()` already exists, and is the same as ::default(). I couldn't find any usages of it.

I made `new()` deprecated, but the new method had to be something else - `new_from(val)`. Ideally, `new_from` should become `new(val)`

Similar to georust#777
nyurik added a commit to nyurik/geo that referenced this pull request Mar 19, 2022
Make migration simpler by using static function that will still be available if `MultiLineString` becomes a type alias.

Similar to georust#777
nyurik added a commit to nyurik/geo that referenced this pull request Mar 19, 2022
Make migration simpler by using static function that will still be available if `GeometryCollection` becomes a type alias.

Note that `GeometryCollection::new()` already exists, and is the same as ::default(). I couldn't find any usages of it.

I made `new()` deprecated, but the new method had to be something else - `new_from(val)`. Ideally, `new_from` should become `new(val)`

Similar to georust#777
@frewsxcv
Copy link
Member

bors r+

@bors
Copy link
Contributor

bors bot commented Mar 19, 2022

Build succeeded:

@bors bors bot merged commit d040fe2 into georust:master Mar 19, 2022
bors bot added a commit that referenced this pull request Mar 28, 2022
786: Use `MultiPolygon::new()` instead of `MultiPolygon()` r=frewsxcv a=nyurik

Make migration simpler by using static function that will still be available if `MultiPolygon` becomes a type alias.

Similar to #777

- [x] I agree to follow the project's [code of conduct](https://github.com/georust/geo/blob/master/CODE_OF_CONDUCT.md).
- [ ] I added an entry to `CHANGES.md` if knowledge of this change could be valuable to users.
---



Co-authored-by: Yuri Astrakhan <YuriAstrakhan@gmail.com>
bors bot added a commit that referenced this pull request Mar 28, 2022
783: Use `Triangle::new()` instead of `Triangle()` r=frewsxcv a=nyurik

Make migration simpler by using static function that will still be available if `Triangle` becomes a type alias.

Similar to #777

- [x] I agree to follow the project's [code of conduct](https://github.com/georust/geo/blob/master/CODE_OF_CONDUCT.md).
- ~[ ] I added an entry to `CHANGES.md` if knowledge of this change could be valuable to users.~
---



Co-authored-by: Yuri Astrakhan <YuriAstrakhan@gmail.com>
bors bot added a commit that referenced this pull request Mar 28, 2022
778: Use `MultiPoint::new()` instead of `MultiPoint()` r=frewsxcv a=nyurik

Make migration simpler by using static function that will still be available if `MultiPoint` becomes a type alias.

Similar to #777

- [x] I agree to follow the project's [code of conduct](https://github.com/georust/geo/blob/master/CODE_OF_CONDUCT.md).
- ~[ ] I added an entry to `CHANGES.md` if knowledge of this change could be valuable to users.~
---



Co-authored-by: Yuri Astrakhan <YuriAstrakhan@gmail.com>
nyurik added a commit to nyurik/geo that referenced this pull request Mar 28, 2022
Make migration simpler by using static function that will still be available if `GeometryCollection` becomes a type alias.

Note that `GeometryCollection::new()` already exists, and is the same as ::default(). I couldn't find any usages of it.

I made `new()` deprecated, but the new method had to be something else - `new_from(val)`. Ideally, `new_from` should become `new(val)`

Similar to georust#777
nyurik added a commit to nyurik/geo that referenced this pull request Mar 28, 2022
Make migration simpler by using static function that will still be available if `MultiLineString` becomes a type alias.

Similar to georust#777
bors bot added a commit that referenced this pull request Mar 28, 2022
784: Use `MultiLineString::new()` instead of `MultiLineString()` r=frewsxcv a=nyurik

Make migration simpler by using static function that will still be available if `MultiLineString` becomes a type alias.

Similar to #777

- [x] I agree to follow the project's [code of conduct](https://github.com/georust/geo/blob/master/CODE_OF_CONDUCT.md).
- ~[ ] I added an entry to `CHANGES.md` if knowledge of this change could be valuable to users.~
---



Co-authored-by: Yuri Astrakhan <YuriAstrakhan@gmail.com>
bors bot added a commit that referenced this pull request Mar 28, 2022
782: Use `GeometryCollection::new_from()` instead of `GeometryCollection()` r=frewsxcv a=nyurik

Make migration simpler by using static function that will still be available if `GeometryCollection` becomes a type alias.

Note that `GeometryCollection::new()` already exists, and is the same as ::default(). I couldn't find any usages of it.

I made `new()` deprecated, but the new method had to be something else - `new_from(val)`. Ideally, `new_from` should become `new(val)`

Similar to #777

- [x] I agree to follow the project's [code of conduct](https://github.com/georust/geo/blob/master/CODE_OF_CONDUCT.md).
- ~[ ] I added an entry to `CHANGES.md` if knowledge of this change could be valuable to users.~
---



Co-authored-by: Yuri Astrakhan <YuriAstrakhan@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants