From a1b8d4cf4df5fa98fcaed822f4b288f3327babf3 Mon Sep 17 00:00:00 2001 From: Yuri Astrakhan Date: Sun, 20 Feb 2022 21:45:16 -0500 Subject: [PATCH] Spell checking and a few minor fixes * Fixes a few typos and commas * Remove non-working anchor in CONTRIBUTING.md * Fixed a few links in CONTRIBUTING.md * Add .idea to the gitignore --- .gitignore | 1 + CODE_OF_CONDUCT.md | 10 +++++----- CONTRIBUTING.md | 11 +++++------ geo-types/CHANGES.md | 6 +++--- geo-types/src/point.rs | 8 ++++---- geo/CHANGES.md | 2 +- geo/src/algorithm/area.rs | 2 +- geo/src/algorithm/dimensions.rs | 2 +- geo/src/algorithm/intersects/mod.rs | 2 +- .../relate/geomgraph/index/segment_intersector.rs | 2 +- .../algorithm/relate/geomgraph/intersection_matrix.rs | 6 +++--- geo/src/algorithm/relate/relate_operation.rs | 4 ++-- geo/src/algorithm/rotate.rs | 8 ++++---- geo/src/algorithm/simplify.rs | 4 ++-- geo/src/algorithm/simplifyvw.rs | 2 +- geo/src/algorithm/winding_order.rs | 2 +- geo/src/utils.rs | 2 +- 17 files changed, 37 insertions(+), 37 deletions(-) diff --git a/.gitignore b/.gitignore index 972b0c475..36a8b8ba9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ **/target **/Cargo.lock +.idea diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 879d50ab3..0ca8fd65e 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -12,8 +12,8 @@ This document is based on, and aims to track the [Rust Code of Conduct](https:// * Respect that people have differences of opinion and that every design or implementation choice carries a trade-off and numerous costs. There is seldom a right answer. * Please keep unstructured critique to a minimum. If you have solid ideas you want to experiment with, make a fork and see how it works. * We will exclude you from interaction if you insult, demean or harass anyone. That is not welcome behavior. We interpret the term "harassment" as including the definition in the Citizen Code of Conduct; if you have any lack of clarity about what might be included in that concept, please read their definition. In particular, we don't tolerate behavior that excludes people in socially marginalized groups. -* Private harassment is also unacceptable. No matter who you are, if you feel you have been or are being harassed or made uncomfortable by a community member, please contact one of the channel ops or any of the [GeoRust moderation team][mod_team] immediately. Whether you're a regular contributor or a newcomer, we care about making this community a safe place for you and we've got your back. -* Likewise any spamming, trolling, flaming, baiting or other attention-stealing behavior is not welcome. +* Private harassment is also unacceptable. No matter who you are, if you feel you have been or are being harassed or made uncomfortable by a community member, please contact one of the channel ops or any of the [GeoRust moderation team][mod_team] immediately. Whether you're a regular contributor or a newcomer, we care about making this community a safe place for you, and we've got your back. +* Likewise, any spamming, trolling, flaming, baiting or other attention-stealing behavior is not welcome. ## Moderation @@ -25,13 +25,13 @@ These are the policies for upholding our community's standards of conduct. If yo 3. Moderators will first respond to such remarks with a warning. 4. If the warning is unheeded, the user will be "kicked," i.e., kicked out of the communication channel to cool off. 5. If the user comes back and continues to make trouble, they will be banned, i.e., indefinitely excluded. -6. Moderators may choose at their discretion to un-ban the user if it was a first offense and they offer the offended party a genuine apology. -7. If a moderator bans someone and you think it was unjustified, please take it up with that moderator, or with a different moderator, **in private**. Complaints about bans in-channel are not allowed. +6. Moderators may choose at their discretion to un-ban the user if it was a first offense, and they offer the offended party a genuine apology. +7. If a moderator bans someone, and you think it was unjustified, please take it up with that moderator, or with a different moderator, **in private**. Complaints about bans in-channel are not allowed. 8. Moderators are held to a higher standard than other community members. If a moderator creates an inappropriate situation, they should expect less leeway than others. In the GeoRust community we strive to go the extra step to look out for each other. Don't just aim to be technically unimpeachable, try to be your best self. In particular, avoid flirting with offensive or sensitive issues, particularly if they're off-topic; this all too often leads to unnecessary fights, hurt feelings, and damaged trust; worse, it can drive people away from the community entirely. -And if someone takes issue with something you said or did, resist the urge to be defensive. Just stop doing what it was they complained about and apologize. Even if you feel you were misinterpreted or unfairly accused, chances are good there was something you could've communicated better — remember that it's your responsibility to make your fellow Rustaceans comfortable. Everyone wants to get along and we are all here first and foremost because we want to talk about cool technology. You will find that people will be eager to assume good intent and forgive as long as you earn their trust. +And if someone takes issue with something you said or did, resist the urge to be defensive. Just stop doing what it was they complained about and apologize. Even if you feel you were misinterpreted or unfairly accused, chances are good there was something you could've communicated better — remember that it's your responsibility to make your fellow Rustaceans comfortable. Everyone wants to get along, and we are all here first and foremost because we want to talk about cool technology. You will find that people will be eager to assume good intent and forgive as long as you earn their trust. *Adapted from the [Node.js Policy on Trolling](http://blog.izs.me/post/30036893703/policy-on-trolling) as well as the [Contributor Covenant v1.3.0](https://www.contributor-covenant.org/version/1/3/0/).* diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 15153926b..3795a0c57 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -9,7 +9,7 @@ sections: * [Feature Requests](#feature-requests) * [Bug Reports](#bug-reports) * [Pull Requests](#pull-requests) -* [Writing Tests and Documentation](#writing-documentation) +* [Writing Tests and Documentation](#writing-tests-and-documentation) As a reminder, all contributors are expected to follow our [Code of Conduct][coc]. @@ -19,7 +19,7 @@ As a reminder, all contributors are expected to follow our [Code of Conduct][coc [feature-requests]: #feature-requests `geo` aims to provide a broad suite of functionality. If -you're in any doubt as to whether a feature can be included, +you're in any doubt whether a feature can be included, simply open an issue and ask. It's a good idea to check open issues and pull requests first, in order to check whether a requested feature is already in progress. @@ -39,7 +39,7 @@ always work, and sometimes it's hard to know what to search for, so consider thi extra credit. We won't mind if you accidentally file a duplicate report. Similarly, to help others who encountered the bug find your -issue, consider filing an issue with with a descriptive +issue, consider filing an issue with a descriptive title, which contains information that might be unique to it. This can be the language or compiler feature used, the conditions that trigger the bug, or part of the error @@ -111,14 +111,13 @@ we support. If it all works out, @bors will merge your code into `master` and close the pull request. ## Writing Tests and Documentation -[writing-documentation]: #writing-documentation Documentation improvements are very welcome. Standard API documentation is generated from the source code itself. If you're adding a new feature, you **must** document its use, and write tests, preferably covering 100% of the added functionality. [Several -geometries](geo/src/algorithm/test_fixtures) are provided as +geometries](geo-test-fixtures) are provided as test fixtures. If you need help with the format or content of docs, or help writing some tests, don't hesitate to ask. @@ -138,7 +137,7 @@ releases may involve all three. If publishing more than one, that, a breaking change should be released with a change in the major version number. -1. If there is a dependency on the other sub-crates (eg. +1. If there is a dependency on the other sub-crates (e.g. `geo` depends on `geo-types`), ensure the major version matches the latest release, and the minor the minimum version needed to compile. diff --git a/geo-types/CHANGES.md b/geo-types/CHANGES.md index 6491c75a7..2691277e8 100644 --- a/geo-types/CHANGES.md +++ b/geo-types/CHANGES.md @@ -12,7 +12,7 @@ * * Add +=, -=, \*=, and /= for Point * -* Note: The MSRV when installing latest dependencies has increased to 1.55 +* Note: The MSRV when installing the latest dependencies has increased to 1.55 * ## 0.7.2 @@ -66,7 +66,7 @@ * * Add `Triangle` and `Rect` to `Geometry` * -* Introduce `Rect::try_new` constructor which doesn’t panic +* Introduce `Rect::try_new` constructor which does not panic * * Add `Rect::center` method * @@ -155,7 +155,7 @@ * * Introduce `x_y` method on `Point` and `Coordinate` * -* Migrate `Line` aand `LineString` to be a series of `Coordinates` (not `Points`). +* Migrate `Line` and `LineString` to be a series of `Coordinates` (not `Points`). * * Introduce Triangle geometry type. * diff --git a/geo-types/src/point.rs b/geo-types/src/point.rs index 9fdfd4a72..328a3b925 100644 --- a/geo-types/src/point.rs +++ b/geo-types/src/point.rs @@ -173,7 +173,7 @@ where /// /// assert_eq!(p.x(), 1.234); /// ``` - #[deprecated = "use `Point::x` instead, it's less ambigous"] + #[deprecated = "use `Point::x` instead, it's less ambiguous"] pub fn lng(self) -> T { self.x() } @@ -191,7 +191,7 @@ where /// /// assert_eq!(p.x(), 9.876); /// ``` - #[deprecated = "use `Point::set_x` instead, it's less ambigous"] + #[deprecated = "use `Point::set_x` instead, it's less ambiguous"] pub fn set_lng(&mut self, lng: T) -> &mut Point { self.set_x(lng) } @@ -207,7 +207,7 @@ where /// /// assert_eq!(p.y(), 2.345); /// ``` - #[deprecated = "use `Point::y` instead, it's less ambigous"] + #[deprecated = "use `Point::y` instead, it's less ambiguous"] pub fn lat(self) -> T { self.y() } @@ -224,7 +224,7 @@ where /// /// assert_eq!(p.y(), 9.876); /// ``` - #[deprecated = "use `Point::set_y` instead, it's less ambigous"] + #[deprecated = "use `Point::set_y` instead, it's less ambiguous"] pub fn set_lat(&mut self, lat: T) -> &mut Point { self.set_y(lat) } diff --git a/geo/CHANGES.md b/geo/CHANGES.md index 4917d724f..c61c56244 100644 --- a/geo/CHANGES.md +++ b/geo/CHANGES.md @@ -22,7 +22,7 @@ * * Add missing `Intersects` implementations * -* Note: The MSRV when installing latest dependencies has increased to 1.55 +* Note: The MSRV when installing the latest dependencies has increased to 1.55 * * Add `get()` to `IntersectionMatrix` for directly querying DE-9IM matrices * diff --git a/geo/src/algorithm/area.rs b/geo/src/algorithm/area.rs index b3f4cfb78..e85e4753b 100644 --- a/geo/src/algorithm/area.rs +++ b/geo/src/algorithm/area.rs @@ -24,7 +24,7 @@ where // determinants. // // Note: we can't use the `Centroid` trait as it - // requries `T: Float` and in fact computes area in the + // requires `T: Float` and in fact computes area in the // implementation. Another option is to use the average // of the coordinates, but it is not fool-proof to // divide by the length of the linestring (eg. a long diff --git a/geo/src/algorithm/dimensions.rs b/geo/src/algorithm/dimensions.rs index 117aa067e..658abbe9a 100644 --- a/geo/src/algorithm/dimensions.rs +++ b/geo/src/algorithm/dimensions.rs @@ -25,7 +25,7 @@ use crate::{ /// ``` #[derive(Debug, Clone, Copy, PartialEq, Eq, Ord, PartialOrd)] pub enum Dimensions { - /// Some geometries, like a `MultiPoint` or `GeometryColletion` may have no elements - thus no + /// Some geometries, like a `MultiPoint` or `GeometryCollection` may have no elements - thus no /// dimensions. Note that this is distinct from being `ZeroDimensional`, like a `Point`. Empty, /// Dimension of a point diff --git a/geo/src/algorithm/intersects/mod.rs b/geo/src/algorithm/intersects/mod.rs index 9366662c8..6a7aef9ef 100644 --- a/geo/src/algorithm/intersects/mod.rs +++ b/geo/src/algorithm/intersects/mod.rs @@ -570,7 +570,7 @@ mod test { #[test] fn compile_test_geom_geom() { - // This test should check existance of all + // This test should check existence of all // combinations of geometry types. let geom: Geometry<_> = Line::from([(0.5, 0.5), (2., 1.)]).into(); assert!(geom.intersects(&geom)); diff --git a/geo/src/algorithm/relate/geomgraph/index/segment_intersector.rs b/geo/src/algorithm/relate/geomgraph/index/segment_intersector.rs index ed1fca229..1efb1dd4c 100644 --- a/geo/src/algorithm/relate/geomgraph/index/segment_intersector.rs +++ b/geo/src/algorithm/relate/geomgraph/index/segment_intersector.rs @@ -136,7 +136,7 @@ where ) { if self.edges_are_from_same_geometry || !intersection.is_proper() { // In the case of self-noding, `edge0` might alias `edge1`, so it's imperative that - // the mutable borrow's are short lived and do not overlap. + // the mutable borrows are short lived and do not overlap. edge0 .borrow_mut() .add_intersections(intersection, line_0, segment_index_0); diff --git a/geo/src/algorithm/relate/geomgraph/intersection_matrix.rs b/geo/src/algorithm/relate/geomgraph/intersection_matrix.rs index f12fe16bf..fb9f356b3 100644 --- a/geo/src/algorithm/relate/geomgraph/intersection_matrix.rs +++ b/geo/src/algorithm/relate/geomgraph/intersection_matrix.rs @@ -3,7 +3,7 @@ use crate::algorithm::{coordinate_position::CoordPos, dimensions::Dimensions}; /// Models a *Dimensionally Extended Nine-Intersection Model (DE-9IM)* matrix. /// /// DE-9IM matrix values (such as "212FF1FF2") specify the topological relationship between -/// two [Geometeries](struct.Geometry.html). +/// two [Geometries](struct.Geometry.html). /// /// DE-9IM matrices are 3x3 matrices that represent the topological locations /// that occur in a geometry (Interior, Boundary, Exterior). @@ -25,7 +25,7 @@ pub struct IntersectionMatrix(LocationArray>); /// Helper struct so we can index IntersectionMatrix by CoordPos /// -/// CoordPos enum members are ordered: OnBondary, Inside, Outside +/// CoordPos enum members are ordered: OnBoundary, Inside, Outside /// DE-9IM matrices are ordered: Inside, Boundary, Exterior /// /// So we can't simply `CoordPos as usize` without losing the conventional ordering @@ -234,7 +234,7 @@ impl IntersectionMatrix { /// // The intersection of the two interiors is empty, because no part of the string is inside the rect /// assert_eq!(intersection.get(CoordPos::Inside, CoordPos::Inside), Dimensions::Empty); /// - /// // The intersection of the line string's interior with the rect's boundary is one-dimensoinal, because part of the first line overlaps one of the rect's edges + /// // The intersection of the line string's interior with the rect's boundary is one-dimensional, because part of the first line overlaps one of the rect's edges /// assert_eq!(intersection.get(CoordPos::Inside, CoordPos::OnBoundary), Dimensions::OneDimensional); /// /// // The intersection of the line string's interior with the rect's exterior is one-dimensional, because part of the string is outside the rect diff --git a/geo/src/algorithm/relate/relate_operation.rs b/geo/src/algorithm/relate/relate_operation.rs index a228b5fe6..acd4388db 100644 --- a/geo/src/algorithm/relate/relate_operation.rs +++ b/geo/src/algorithm/relate/relate_operation.rs @@ -260,7 +260,7 @@ where } } - /// Insert nodes for all intersections on the edges of a Geometry. + /// Insert nodes for all intersections on the edges of a Geometry. /// /// Label the created nodes the same as the edge label if they do not already have a label. /// This allows nodes created by either self-intersections or mutual intersections to be @@ -397,7 +397,7 @@ where } /// Isolated nodes are nodes whose labels are incomplete (e.g. the location for one Geometry is - /// null). + /// null). /// This is the case because nodes in one graph which don't intersect nodes in the other /// are not completely labeled by the initial process of adding nodes to the nodeList. To /// complete the labelling we need to check for nodes that lie in the interior of edges, and in diff --git a/geo/src/algorithm/rotate.rs b/geo/src/algorithm/rotate.rs index 9c0b92288..526c24607 100644 --- a/geo/src/algorithm/rotate.rs +++ b/geo/src/algorithm/rotate.rs @@ -82,9 +82,9 @@ pub trait Rotate { T: CoordFloat; #[deprecated( - note = "Equivalent to `rotate_around_centroid` except for `Polygon`, - where it is equivalent to rotating around the polygon's outer ring. - Call that instead, or `rotate_around_center` if you'd like to rotate + note = "Equivalent to `rotate_around_centroid` except for `Polygon`, + where it is equivalent to rotating around the polygon's outer ring. + Call that instead, or `rotate_around_center` if you'd like to rotate around the geometry's bounding box center." )] fn rotate(&self, angle: T) -> Self @@ -672,7 +672,7 @@ mod test { .into(); // results agree with Shapely / GEOS - // (relaxing the episilon a bit) + // (relaxing the epsilon a bit) assert_relative_eq!( multipolygon.rotate_around_centroid(45.), expected_centroid, diff --git a/geo/src/algorithm/simplify.rs b/geo/src/algorithm/simplify.rs index b5fb9aeff..b6289dbba 100644 --- a/geo/src/algorithm/simplify.rs +++ b/geo/src/algorithm/simplify.rs @@ -102,11 +102,11 @@ where /// Simplifies a geometry. /// /// The [Ramer–Douglas–Peucker -/// algorithm](https://en.wikipedia.org/wiki/Ramer–Douglas–Peucker_algorithm) simplifes a +/// algorithm](https://en.wikipedia.org/wiki/Ramer–Douglas–Peucker_algorithm) simplifies a /// linestring. Polygons are simplified by running the RDP algorithm on all their constituent /// rings. This may result in invalid Polygons, and has no guarantee of preserving topology. /// -/// Multi* objects are simplified by simplifing all their constituent geometries individually. +/// Multi* objects are simplified by simplifying all their constituent geometries individually. /// /// An epsilon less than or equal to zero will return an unaltered version of the geometry. pub trait Simplify { diff --git a/geo/src/algorithm/simplifyvw.rs b/geo/src/algorithm/simplifyvw.rs index 26efdba09..fad1fb1dd 100644 --- a/geo/src/algorithm/simplifyvw.rs +++ b/geo/src/algorithm/simplifyvw.rs @@ -321,7 +321,7 @@ where assert!(tree.remove(&line_1).is_some()); assert!(tree.remove(&line_2).is_some()); - // Restore continous line segment + // Restore continuous line segment tree.insert(Line::new(left_point, right_point)); // Now recompute the adjacent triangle(s), using left and right adjacent points diff --git a/geo/src/algorithm/winding_order.rs b/geo/src/algorithm/winding_order.rs index 662803419..89e3a214e 100644 --- a/geo/src/algorithm/winding_order.rs +++ b/geo/src/algorithm/winding_order.rs @@ -66,7 +66,7 @@ pub trait Winding { /// order, so that the resultant order makes it appear counter-clockwise fn points_ccw(&self) -> Points; - /// Change this objects's points so they are in clockwise winding order + /// Change this object's points so they are in clockwise winding order fn make_cw_winding(&mut self); /// Change this line's points so they are in counterclockwise winding order diff --git a/geo/src/utils.rs b/geo/src/utils.rs index c9f4d9bd8..ea2589df2 100644 --- a/geo/src/utils.rs +++ b/geo/src/utils.rs @@ -81,7 +81,7 @@ use std::cmp::Ordering; /// Compare two coordinates lexicographically: first by the /// x coordinate, and break ties with the y coordinate. -/// Expects none of coordinates to be uncomparable (eg. nan) +/// Expects none of coordinates to be incomparable (eg. nan) #[inline] pub fn lex_cmp(p: &Coordinate, q: &Coordinate) -> Ordering { p.x.partial_cmp(&q.x)