Skip to content

Commit

Permalink
Extend lifetime of layers from GroupLayer::get_layer
Browse files Browse the repository at this point in the history
  • Loading branch information
aleokdev committed Aug 18, 2024
1 parent ab62d91 commit 38d93e4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
## Changed
- Extend lifetime of `Layer`s returned from `GroupLayer::get_layer` to the map's.

## [0.12.0]
### Added
- Add `text`, `width` and `height` members to `ObjectShape::Text`. (#278)
Expand Down
2 changes: 1 addition & 1 deletion src/layers/group.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ impl<'map> GroupLayer<'map> {
.map(move |layer| Layer::new(map, layer))
}
/// Gets a specific layer from the group by index.
pub fn get_layer(&self, index: usize) -> Option<Layer> {
pub fn get_layer(&self, index: usize) -> Option<Layer<'map>> {
self.data
.layers
.get(index)
Expand Down

0 comments on commit 38d93e4

Please sign in to comment.