Skip to content

Commit d9092fc

Browse files
authored
fix: references, not ownership, in geoparquet store writer (#929)
1 parent 98c05ca commit d9092fc

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

crates/io/src/store.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -210,9 +210,8 @@ pub mod geoparquet {
210210
/// Adds a collection to this writer's metadata.
211211
///
212212
/// Warns and overwrites if there's already a collection with the same id.
213-
pub fn add_collection(mut self, collection: Collection) -> StacGeoparquetObjectWriter {
213+
pub fn add_collection(&mut self, collection: Collection) {
214214
self.state.add_collection(collection);
215-
self
216215
}
217216

218217
pub async fn close(mut self) -> Result<()> {
@@ -293,16 +292,16 @@ mod tests {
293292
let item: Item = stac::read("examples/simple-item.json").unwrap();
294293
let collection = stac::Collection::new("test-collection", "Test description");
295294

296-
let writer = StacGeoparquetObjectWriter::new(
295+
let mut writer = StacGeoparquetObjectWriter::new(
297296
store.clone(),
298297
Path::from("test-with-collection"),
299298
vec![item.clone()],
300299
Default::default(),
301300
Default::default(),
302301
)
303302
.await
304-
.unwrap()
305-
.add_collection(collection);
303+
.unwrap();
304+
writer.add_collection(collection);
306305

307306
writer.close().await.unwrap();
308307

0 commit comments

Comments
 (0)