Skip to content

Commit

Permalink
Merge branch 'master' into ed2021
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelkirk authored Mar 8, 2022
2 parents db99a1a + 560dd24 commit fb9dbec
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 19 deletions.
21 changes: 11 additions & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
name: ci result
runs-on: ubuntu-latest
needs:
- clippy
- lint
- geo_types
- geo
- geo_postgis
Expand All @@ -35,21 +35,22 @@ jobs:
if: "!success()"
run: exit 1

clippy:
name: clippy
lint:
name: lint
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[skip ci]')"
strategy:
matrix:
container_image:
# Use the latest stable clippy. No need for older versions.
- "georust/geo-ci:rust-1.58"
# Use the latest stable version. No need for older versions.
- "georust/geo-ci:rust-1.59"
container:
image: ${{ matrix.container_image }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
- run: rustup component add clippy
- run: rustup component add rustfmt clippy
- run: cargo fmt --all -- --check
- run: cargo clippy --all-features --all-targets -- -Dwarnings

geo_types:
Expand All @@ -68,8 +69,8 @@ jobs:
# Minimum supported rust version (MSRV)
- "georust/geo-ci:rust-1.56"
# Two most recent releases - we omit older ones for expedient CI
- "georust/geo-ci:rust-1.57"
- "georust/geo-ci:rust-1.58"
- "georust/geo-ci:rust-1.59"
container:
image: ${{ matrix.container_image }}
steps:
Expand All @@ -94,8 +95,8 @@ jobs:
# Minimum supported rust version (MSRV)
- "georust/geo-ci:rust-1.56"
# Two most recent releases - we omit older ones for expedient CI
- "georust/geo-ci:rust-1.57"
- "georust/geo-ci:rust-1.58"
- "georust/geo-ci:rust-1.59"
container:
image: ${{ matrix.container_image }}
steps:
Expand All @@ -121,8 +122,8 @@ jobs:
# Minimum supported rust version (MSRV)
- "georust/geo-ci:rust-1.56"
# Two most recent releases - we omit older ones for expedient CI
- "georust/geo-ci:rust-1.57"
- "georust/geo-ci:rust-1.58"
- "georust/geo-ci:rust-1.59"
container:
image: ${{ matrix.container_image }}
steps:
Expand All @@ -142,7 +143,7 @@ jobs:
matrix:
container_image:
# Fuzz only on latest
- "georust/geo-ci:rust-1.57"
- "georust/geo-ci:rust-1.59"
container:
image: ${{ matrix.container_image }}
steps:
Expand Down
3 changes: 2 additions & 1 deletion geo-types/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

* Note: All crates have been migrated to Rust 2021 edition. The MSRV when installing the latest dependencies has increased to 1.56.
* <https://github.com/georust/geo/pull/741>
*
* Macros `coord!`, `point!`, `line_string!`, and `polygon!` now support trailing commas such as `coord! { x: 181.2, y: 51.79, }`
* <https://github.com/georust/geo/pull/752>

## 0.7.3

Expand Down
15 changes: 7 additions & 8 deletions geo-types/src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
/// [`Point`]: ./struct.Point.html
#[macro_export]
macro_rules! point {
(x: $x:expr, y: $y:expr) => {
(x: $x:expr, y: $y:expr $(,)?) => {
$crate::Point::new($x, $y)
};
}
Expand All @@ -48,7 +48,7 @@ macro_rules! point {
/// [`Coordinate`]: ./struct.Point.html
#[macro_export]
macro_rules! coord {
(x: $x:expr, y: $y:expr) => {
(x: $x:expr, y: $y:expr $(,)?) => {
$crate::Coordinate { x: $x, y: $y }
};
}
Expand All @@ -70,7 +70,7 @@ macro_rules! coord {
/// (x: -21.95156, y: 64.1446),
/// (x: -21.951, y: 64.14479),
/// (x: -21.95044, y: 64.14527),
/// (x: -21.951445, y: 64.145508)
/// (x: -21.951445, y: 64.145508),
/// ];
///
/// assert_eq!(ls[1], geo_types::Coordinate {
Expand Down Expand Up @@ -118,7 +118,7 @@ macro_rules! coord {
macro_rules! line_string {
() => { $crate::LineString(vec![]) };
(
$((x: $x:expr, y: $y:expr)),*
$((x: $x:expr, y: $y:expr $(,)?)),*
$(,)?
) => {
line_string![
Expand Down Expand Up @@ -212,12 +212,12 @@ macro_rules! polygon {
() => { $crate::Polygon::new(line_string![], vec![]) };
(
exterior: [
$((x: $exterior_x:expr, y: $exterior_y:expr)),*
$((x: $exterior_x:expr, y: $exterior_y:expr $(,)?)),*
$(,)?
],
interiors: [
$([
$((x: $interior_x:expr, y: $interior_y:expr)),*
$((x: $interior_x:expr, y: $interior_y:expr $(,)?)),*
$(,)?
]),*
$(,)?
Expand All @@ -234,7 +234,6 @@ macro_rules! polygon {
$([
$($crate::Coordinate { x: $interior_x, y: $interior_y }),*
]),*

],
)
};
Expand Down Expand Up @@ -268,7 +267,7 @@ macro_rules! polygon {
)
};
(
$((x: $x:expr, y: $y:expr)),*
$((x: $x:expr, y: $y:expr $(,)?)),*
$(,)?
) => {
polygon![
Expand Down

0 comments on commit fb9dbec

Please sign in to comment.