From 2a2a58ff66f61f566a7e341a4b2b4cc2860f8381 Mon Sep 17 00:00:00 2001 From: Pete Gadomski Date: Wed, 12 Jul 2023 08:12:49 -0600 Subject: [PATCH] feat: impl default for api item_collection --- stac-api/CHANGELOG.md | 1 + stac-api/src/item_collection.rs | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/stac-api/CHANGELOG.md b/stac-api/CHANGELOG.md index dabda23c..328fbb9e 100644 --- a/stac-api/CHANGELOG.md +++ b/stac-api/CHANGELOG.md @@ -12,6 +12,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), - `schemars` feature ([#177](https://github.com/gadomski/stac-rs/pull/177)) - `PartialEq` to `Filter` ([#179](https://github.com/gadomski/stac-rs/pull/179)) - `TryFrom` to go between `Items` and `GetItems` ([#179](https://github.com/gadomski/stac-rs/pull/179)) +- `Default` for `ItemCollection` ([#183](https://github.com/gadomski/stac-rs/pull/183)) ### Changed diff --git a/stac-api/src/item_collection.rs b/stac-api/src/item_collection.rs index ccc97265..b82aec9e 100644 --- a/stac-api/src/item_collection.rs +++ b/stac-api/src/item_collection.rs @@ -97,3 +97,17 @@ impl Links for ItemCollection { &mut self.links } } + +impl Default for ItemCollection { + fn default() -> Self { + ItemCollection { + r#type: "FeatureCollection".to_string(), + items: Vec::new(), + links: Vec::new(), + number_matched: None, + number_returned: None, + context: None, + additional_fields: Map::default(), + } + } +}