Skip to content

Commit 71ea7c3

Browse files
committed
Bump edition
1 parent fdc6a14 commit 71ea7c3

File tree

33 files changed

+97
-91
lines changed

33 files changed

+97
-91
lines changed

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ default-members = ["ogcapi"]
1616
[workspace.package]
1717
license = "MIT OR Apache-2.0"
1818
repository = "https://github.com/georust/ogcapi"
19-
edition = "2021"
19+
edition = "2024"
2020
categories = ["science::geospatial"]
2121
keywords = ["geography", "geo", "geospatial", "gis", "api"]
2222

examples/data-loader/src/geojson.rs

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
use std::{convert::TryInto, io::Cursor, time::Instant};
22

33
use geo::Geometry;
4-
use geojson::{feature::Id, FeatureCollection};
4+
use geojson::{FeatureCollection, feature::Id};
55
use sqlx::types::Json;
66
use wkb::Endianness;
77

88
use ogcapi::{
9-
drivers::{postgres::Db, CollectionTransactions},
9+
drivers::{CollectionTransactions, postgres::Db},
1010
types::common::{Collection, Crs, Extent, SpatialExtent},
1111
};
1212

@@ -30,10 +30,11 @@ pub async fn load(args: Args) -> anyhow::Result<()> {
3030
.bbox
3131
.map(|bbox| Extent {
3232
spatial: Some(SpatialExtent {
33-
bbox: vec![bbox
34-
.as_slice()
35-
.try_into()
36-
.unwrap_or_else(|_| [-180.0, -90.0, 180.0, 90.0].into())],
33+
bbox: vec![
34+
bbox.as_slice()
35+
.try_into()
36+
.unwrap_or_else(|_| [-180.0, -90.0, 180.0, 90.0].into()),
37+
],
3738
crs: Crs::default(),
3839
}),
3940
..Default::default()

examples/data-loader/src/main.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use clap::Parser;
2-
use tracing_subscriber::{prelude::*, EnvFilter};
2+
use tracing_subscriber::{EnvFilter, prelude::*};
33

44
#[tokio::main]
55
async fn main() -> anyhow::Result<()> {
@@ -35,7 +35,9 @@ async fn main() -> anyhow::Result<()> {
3535
data_loader::ogr::load(args).await?
3636
}
3737
x => {
38-
tracing::warn!("No loader found for extension `{x:?}`! May need to activate additional features.");
38+
tracing::warn!(
39+
"No loader found for extension `{x:?}`! May need to activate additional features."
40+
);
3941
}
4042
}
4143
}

examples/data-loader/src/ogr.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ use arrow::{
88
json::ArrayWriter,
99
};
1010
use gdal::{
11-
cpl::CslStringList, spatial_ref::SpatialRef, vector::LayerAccess, ArrowArrayStream, Dataset,
11+
ArrowArrayStream, Dataset, cpl::CslStringList, spatial_ref::SpatialRef, vector::LayerAccess,
1212
};
1313

1414
use ogcapi::{
15-
drivers::{postgres::Db, CollectionTransactions},
15+
drivers::{CollectionTransactions, postgres::Db},
1616
types::common::{Bbox, Collection, Crs, Extent, SpatialExtent},
1717
};
1818

examples/data-loader/src/osm.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use serde_json::{Map, Value};
66
use wkb::Endianness;
77

88
use ogcapi::{
9-
drivers::{postgres::Db, CollectionTransactions},
9+
drivers::{CollectionTransactions, postgres::Db},
1010
types::common::{Collection, Crs},
1111
};
1212

ogcapi-client/src/client.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
use std::cell::OnceCell;
22

33
use reqwest::{
4+
Url,
45
blocking::Client as ReqwestClient,
56
header::{HeaderMap, HeaderValue, USER_AGENT},
6-
Url,
77
};
88

99
#[cfg(not(feature = "stac"))]
1010
use ogcapi_types::features::Feature;
11-
#[cfg(feature = "stac")]
1211
use ogcapi_types::{
1312
common::{
14-
link_rel::{CHILD, ITEM, SELF},
15-
Link,
13+
Collection, Conformance, LandingPage, Links,
14+
link_rel::{CONFORMANCE, DATA, NEXT},
1615
},
17-
stac::{Catalog, Item as Feature, SearchParams, StacEntity},
16+
features::FeatureCollection,
1817
};
18+
#[cfg(feature = "stac")]
1919
use ogcapi_types::{
2020
common::{
21-
link_rel::{CONFORMANCE, DATA, NEXT},
22-
Collection, Conformance, LandingPage, Links,
21+
Link,
22+
link_rel::{CHILD, ITEM, SELF},
2323
},
24-
features::FeatureCollection,
24+
stac::{Catalog, Item as Feature, SearchParams, StacEntity},
2525
};
2626

2727
use crate::Error;

ogcapi-drivers/src/postgres/edr.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ impl EdrQuerier for Db {
6161
)
6262
} else {
6363
format!(
64-
"ST_DWithin(ST_Transform(geom, 4326)::geography, ST_Transform(ST_GeomFromEWKT('SRID={};{}'), 4326)::geography, {}, false)",
65-
srid, query.coords, distance
66-
)
64+
"ST_DWithin(ST_Transform(geom, 4326)::geography, ST_Transform(ST_GeomFromEWKT('SRID={};{}'), 4326)::geography, {}, false)",
65+
srid, query.coords, distance
66+
)
6767
}
6868
}
6969
QueryType::Cube => {

ogcapi-drivers/src/postgres/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ mod style;
1414
mod tile;
1515

1616
use sqlx::{
17+
Postgres,
1718
migrate::MigrateDatabase,
1819
postgres::{PgConnectOptions, PgPool, PgPoolOptions},
19-
Postgres,
2020
};
2121
use url::Url;
2222

ogcapi-drivers/src/s3/collection.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use aws_sdk_s3::{error::SdkError, operation::get_object::GetObjectError};
22

3-
use ogcapi_types::common::{media_type::JSON, Collection, Collections, Query};
3+
use ogcapi_types::common::{Collection, Collections, Query, media_type::JSON};
44

55
use crate::CollectionTransactions;
66

ogcapi-drivers/src/s3/feature.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use aws_sdk_s3::{error::SdkError, operation::get_object::GetObjectError};
22

33
use ogcapi_types::{
4-
common::{media_type::GEO_JSON, Crs},
4+
common::{Crs, media_type::GEO_JSON},
55
features::{Feature, FeatureCollection, Query},
66
};
77

ogcapi-drivers/src/s3/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ mod collection;
22
mod feature;
33

44
use aws_sdk_s3::{
5+
Client, Config,
56
error::SdkError,
67
operation::{
78
delete_object::{DeleteObjectError, DeleteObjectOutput},
89
get_object::{GetObjectError, GetObjectOutput},
910
put_object::{PutObjectError, PutObjectOutput},
1011
},
11-
Client, Config,
1212
};
1313

1414
pub use aws_sdk_s3::primitives::ByteStream;

ogcapi-drivers/tests/job.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#[cfg(feature = "processes")]
22
mod postgres {
3-
use ogcapi_drivers::{postgres::Db, JobHandler};
3+
use ogcapi_drivers::{JobHandler, postgres::Db};
44
use ogcapi_types::processes::{StatusCode, StatusInfo};
55

66
#[sqlx::test]

ogcapi-processes/src/gdal_loader.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ use arrow::{
1313
json::ArrayWriter,
1414
};
1515
use gdal::{
16-
cpl::CslStringList, spatial_ref::SpatialRef, vector::LayerAccess, ArrowArrayStream, Dataset,
16+
ArrowArrayStream, Dataset, cpl::CslStringList, spatial_ref::SpatialRef, vector::LayerAccess,
1717
};
18-
use schemars::{schema_for, JsonSchema};
18+
use schemars::{JsonSchema, schema_for};
1919
use serde::Deserialize;
2020
use url::Url;
2121

22-
use ogcapi_drivers::{postgres::Db, CollectionTransactions};
22+
use ogcapi_drivers::{CollectionTransactions, postgres::Db};
2323
use ogcapi_types::{
2424
common::{Bbox, Collection, Crs, Exception, Extent, SpatialExtent},
2525
processes::{Execute, InlineOrRefData, Input, InputValueNoObject, Process},
@@ -370,8 +370,8 @@ mod tests {
370370
use ogcapi_types::processes::Execute;
371371

372372
use crate::{
373-
gdal_loader::{GdalLoader, GdalLoaderInputs, GdalLoaderOutputs},
374373
Processor,
374+
gdal_loader::{GdalLoader, GdalLoaderInputs, GdalLoaderOutputs},
375375
};
376376

377377
#[tokio::test]

ogcapi-processes/src/geojson_loader.rs

+8-7
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ use anyhow::Result;
44
use geo::Geometry;
55
use geojson::FeatureCollection;
66

7-
use schemars::{schema_for, JsonSchema};
7+
use schemars::{JsonSchema, schema_for};
88
use serde::Deserialize;
99
use sqlx::types::Json;
1010
use url::Url;
1111

12-
use ogcapi_drivers::{postgres::Db, CollectionTransactions};
12+
use ogcapi_drivers::{CollectionTransactions, postgres::Db};
1313
use ogcapi_types::{
1414
common::{Collection, Crs, Exception, Extent, SpatialExtent},
1515
processes::{Execute, InlineOrRefData, Input, InputValueNoObject, Process},
@@ -135,10 +135,11 @@ impl Processor for GeoJsonLoader {
135135
.bbox
136136
.map(|bbox| Extent {
137137
spatial: Some(SpatialExtent {
138-
bbox: vec![bbox
139-
.as_slice()
140-
.try_into()
141-
.unwrap_or_else(|_| [-180.0, -90.0, 180.0, 90.0].into())],
138+
bbox: vec![
139+
bbox.as_slice()
140+
.try_into()
141+
.unwrap_or_else(|_| [-180.0, -90.0, 180.0, 90.0].into()),
142+
],
142143
crs: Crs::default(),
143144
}),
144145
..Default::default()
@@ -221,8 +222,8 @@ mod tests {
221222
use ogcapi_types::processes::Execute;
222223

223224
use crate::{
224-
geojson_loader::{GeoJsonLoader, GeoJsonLoaderInputs, GeoJsonLoaderOutputs},
225225
Processor,
226+
geojson_loader::{GeoJsonLoader, GeoJsonLoaderInputs, GeoJsonLoaderOutputs},
226227
};
227228

228229
#[tokio::test]

ogcapi-processes/src/greeter.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use std::collections::HashMap;
22

33
use anyhow::Result;
4-
use schemars::{schema_for, JsonSchema};
4+
use schemars::{JsonSchema, schema_for};
55
use serde::Deserialize;
66

77
use ogcapi_types::{
@@ -99,8 +99,8 @@ mod tests {
9999
use ogcapi_types::processes::Execute;
100100

101101
use crate::{
102-
greeter::{Greeter, GreeterInputs, GreeterOutputs},
103102
Processor,
103+
greeter::{Greeter, GreeterInputs, GreeterOutputs},
104104
};
105105

106106
#[tokio::test]

ogcapi-services/src/error.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
use axum::{
2-
http::{header::CONTENT_TYPE, StatusCode},
3-
response::{IntoResponse, Response},
42
Json,
3+
http::{StatusCode, header::CONTENT_TYPE},
4+
response::{IntoResponse, Response},
55
};
66
use hyper::HeaderMap;
77

8-
use ogcapi_types::common::{media_type::PROBLEM_JSON, Exception};
8+
use ogcapi_types::common::{Exception, media_type::PROBLEM_JSON};
99

1010
/// A common error type that can be used throughout the API.
1111
///

ogcapi-services/src/extractors.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use anyhow::Context;
22
use axum::{
33
extract::{FromRequestParts, OriginalUri},
4-
http::{request::Parts, StatusCode},
4+
http::{StatusCode, request::Parts},
55
};
66
use axum_extra::extract::Host;
77
use url::Url;

ogcapi-services/src/routes/api.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use axum::{extract::State, http::header::CONTENT_TYPE, response::Html, Json};
1+
use axum::{Json, extract::State, http::header::CONTENT_TYPE, response::Html};
22
use hyper::HeaderMap;
33
use openapiv3::OpenAPI;
44

ogcapi-services/src/routes/collections.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
use axum::{
2-
extract::{Path, State},
3-
http::{header::LOCATION, StatusCode},
42
Json,
5-
{routing::get, Router},
3+
extract::{Path, State},
4+
http::{StatusCode, header::LOCATION},
5+
{Router, routing::get},
66
};
77
use hyper::HeaderMap;
88

99
use ogcapi_types::common::{
10+
Collection, Collections, Crs, Link, Linked, Query,
1011
link_rel::{DATA, ITEMS, ROOT, SELF},
1112
media_type::{GEO_JSON, JSON},
12-
Collection, Collections, Crs, Link, Linked, Query,
1313
};
1414

1515
use crate::{
16-
extractors::{Qs, RemoteUrl},
1716
AppState, Error, Result,
17+
extractors::{Qs, RemoteUrl},
1818
};
1919

2020
const CONFORMANCE: [&str; 3] = [

ogcapi-services/src/routes/edr.rs

+13-11
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
use axum::{
2+
Json, Router,
23
extract::{Path, State},
34
http::header::CONTENT_TYPE,
45
routing::get,
5-
Json, Router,
66
};
77
use hyper::HeaderMap;
88

99
use ogcapi_types::{
10-
common::{link_rel::SELF, media_type::GEO_JSON, Link},
10+
common::{Link, link_rel::SELF, media_type::GEO_JSON},
1111
edr::{Query, QueryType},
1212
features::FeatureCollection,
1313
};
1414

1515
use crate::{
16-
extractors::{Qs, RemoteUrl},
1716
AppState, Result,
17+
extractors::{Qs, RemoteUrl},
1818
};
1919

2020
const CONFORMANCE: [&str; 8] = [
@@ -44,14 +44,16 @@ async fn query(
4444
.await?;
4545

4646
for feature in fc.features.iter_mut() {
47-
feature.links = vec![Link::new(
48-
url.join(&format!(
49-
"items/{}",
50-
feature.id.as_ref().expect("Feature should have id")
51-
))?,
52-
SELF,
53-
)
54-
.mediatype(GEO_JSON)]
47+
feature.links = vec![
48+
Link::new(
49+
url.join(&format!(
50+
"items/{}",
51+
feature.id.as_ref().expect("Feature should have id")
52+
))?,
53+
SELF,
54+
)
55+
.mediatype(GEO_JSON),
56+
]
5557
}
5658

5759
let mut headers = HeaderMap::new();

0 commit comments

Comments
 (0)