Skip to content

Commit 662ca16

Browse files
committed
fix: clippy
1 parent fb82456 commit 662ca16

File tree

11 files changed

+18
-28
lines changed

11 files changed

+18
-28
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
- "-p stac-async"
3131
- "-p stac-cli --no-default-features"
3232
- "-p stac-cli --no-default-features -F geoparquet"
33-
- "-p stac-duckdb -F bundled"
33+
- "-p stac-duckdb -F duckdb/bundled"
3434
- "-p stac-server"
3535
- "-p stac-server -F axum"
3636
- "-p stac-validate"

cli/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ geoparquet = [
2222
"parquet",
2323
]
2424
pgstac = ["stac-server/pgstac"]
25-
python = ["dep:pyo3", "pgstac", "duckdb", "stac-duckdb/bundled", "geoparquet"]
25+
python = ["dep:pyo3", "pgstac", "geoparquet"]
2626

2727
[dependencies]
2828
axum = "0.7"

cli/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ cargo install stac-cli
1717
Or:
1818

1919
```shell
20+
# NOTE: The version from PyPI does not include GDAL or DuckDB support. If you
21+
# need to use these features, install via `cargo install` (GDAL is enabled by
22+
# default) or `cargo install -F duckdb` (DuckDB is not).
2023
pip install stacrs-cli
2124
```
2225

@@ -26,9 +29,6 @@ Then:
2629
stacrs --help
2730
```
2831

29-
**NOTE:** the version from PyPI (installed with `pip`) does not include GDAL support.
30-
If you need to use [gdal](../core/README.md#gdal) features, install via `cargo install`.
31-
3232
## Usage
3333

3434
**stacrs** provides the following subcommands:

cli/src/args/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ impl Input {
194194
fn read(self, infile: Option<String>) -> Result<stac::Value> {
195195
let format = self
196196
.format
197-
.or_else(|| infile.as_deref().and_then(|infile| Format::infer(infile)))
197+
.or_else(|| infile.as_deref().and_then(Format::infer))
198198
.unwrap_or(Format::CompactJson);
199199
if let Some(infile) =
200200
infile.and_then(|infile| if infile == "-" { None } else { Some(infile) })

cli/src/args/search.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -193,13 +193,10 @@ impl Run for Args {
193193
let sender = if self.stream { Some(sender) } else { None };
194194
#[cfg(feature = "duckdb")]
195195
{
196-
if self.duckdb.unwrap_or_else(|| {
197-
tracing::info!(
198-
"inferring whether to use duckdb based on href '{}'",
199-
self.href
200-
);
201-
stac::geoparquet::has_extension(&self.href)
202-
}) {
196+
if self
197+
.duckdb
198+
.unwrap_or_else(|| stac::geoparquet::has_extension(&self.href))
199+
{
203200
search_geoparquet(self.href, search, sender, self.max_items).await
204201
} else {
205202
search_api(self.href, search, sender, self.max_items).await

cli/src/args/serve.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ impl Run for Args {
145145
backend.add_items(items).await?;
146146
}
147147
} else if !items.is_empty() {
148-
let collection_ids: Vec<_> = items.into_keys().filter_map(|o| o).collect();
148+
let collection_ids: Vec<_> = items.into_keys().flatten().collect();
149149
warn!("--create-collections=false, but some items don't have collections and will not be loaded (collection ids: {})", collection_ids.join(","));
150150
}
151151

cli/src/args/validate.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ impl Run for Args {
2222
stac::Value::Item(item) => format!("[item={}] ", item.id),
2323
stac::Value::Catalog(catalog) => format!("[catalog={}] ", catalog.id),
2424
stac::Value::Collection(collection) => format!("[collection={}] ", collection.id),
25-
stac::Value::ItemCollection(_) => format!("[item-collection] "),
25+
stac::Value::ItemCollection(_) => "[item-collection] ".to_string(),
2626
};
2727
for error in errors {
2828
let message = format!(

cli/src/main.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
use clap::Parser;
22
use stac_cli::Args;
3-
use tracing_subscriber;
43

54
#[tokio::main]
65
async fn main() {

cli/src/python.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ use pyo3::{
44
prelude::{PyModule, PyModuleMethods},
55
pyfunction, pymodule, wrap_pyfunction, Bound, PyResult,
66
};
7-
use tracing_subscriber;
87

98
#[pyfunction]
109
fn main() -> PyResult<i64> {

duckdb/Cargo.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ name = "stac-duckdb"
33
version = "0.1.0"
44
edition = "2021"
55

6-
[features]
7-
bundled = ["duckdb/bundled"]
8-
96
[dependencies]
107
arrow = "52"
118
duckdb = "1"

0 commit comments

Comments
 (0)