Skip to content

Commit

Permalink
feat: impl default for api item_collection
Browse files Browse the repository at this point in the history
  • Loading branch information
gadomski committed Jul 12, 2023
1 parent 8ecce31 commit 2a2a58f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions stac-api/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
14 changes: 14 additions & 0 deletions stac-api/src/item_collection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
}
}
}

0 comments on commit 2a2a58f

Please sign in to comment.