Skip to content

Commit

Permalink
Merge pull request #140 from georust/fixes
Browse files Browse the repository at this point in the history
Update minimum supported Rust version to 1.65, add `cargo.lock` and fix new clippy warnings
  • Loading branch information
GuillaumeGomez authored Nov 14, 2023
2 parents a6cd5b7 + 3865987 commit e83f34b
Show file tree
Hide file tree
Showing 5 changed files with 331 additions and 8 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.63.0
toolchain: 1.65.0
override: true
components: rustfmt
- run: cargo fmt -- --check
Expand Down Expand Up @@ -58,7 +58,7 @@ jobs:
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.63.0
toolchain: 1.65.0
override: true

- name: Build static geos crate
Expand All @@ -76,7 +76,7 @@ jobs:
fail-fast: false
matrix:
toolchain:
- 1.63.0
- 1.65.0
- nightly
geos: ["3.6.5", "3.7.5", "3.8.3", "3.9.3", "3.10.3", "3.11.0"]
include:
Expand Down
323 changes: 323 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ categories = ["external-ffi-bindings", "algorithms"]
description = "Rust bindings for GEOS C API"
readme = "README.md"
edition = "2021"
rust-version = "1.63"
rust-version = "1.65"

[features]
dox = ["geo-types", "wkt", "json", "geos-sys/dox"]
Expand Down
2 changes: 1 addition & 1 deletion src/functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ pub(crate) fn create_multi_geom(
let ptr = GEOSGeom_createCollection_r(
context.as_raw(),
output_type.into(),
geoms.as_mut_ptr() as *mut *mut GEOSGeometry,
geoms.as_mut_ptr() as *mut _,
nb_geoms as _,
);
Geometry::new_from_raw(ptr, context, "create_multi_geom")
Expand Down
6 changes: 3 additions & 3 deletions src/geometry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2485,7 +2485,7 @@ impl<'a> Geometry<'a> {
/// ```
pub fn polygonize<T: Borrow<Geometry<'a>>>(geometries: &[T]) -> GResult<Geometry<'a>> {
unsafe {
let context = match geometries.get(0) {
let context = match geometries.first() {
Some(g) => g.borrow().clone_context(),
None => match ContextHandle::init_e(Some("Geometry::polygonize")) {
Ok(context) => Arc::new(context),
Expand All @@ -2506,7 +2506,7 @@ impl<'a> Geometry<'a> {
geometries: &[T],
) -> GResult<Geometry<'a>> {
unsafe {
let context = match geometries.get(0) {
let context = match geometries.first() {
Some(g) => g.borrow().clone_context(),
None => match ContextHandle::init_e(Some("Geometry::polygonizer_get_cut_edges")) {
Ok(context) => Arc::new(context),
Expand Down Expand Up @@ -2796,7 +2796,7 @@ impl<'a> Geometry<'a> {
let ptr = GEOSGeom_createPolygon_r(
context_handle.as_raw(),
exterior.as_raw_mut(),
geoms.as_mut_ptr() as *mut *mut GEOSGeometry,
geoms.as_mut_ptr() as *mut _,
nb_interiors as _,
);
Geometry::new_from_raw(ptr, context_handle, "create_polygon")
Expand Down

0 comments on commit e83f34b

Please sign in to comment.