Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated lifetime of LayerTile returned from TileLayer #254

Merged
merged 1 commit into from
Feb 19, 2023

Conversation

Anti-Alias
Copy link
Contributor

Small PR to change the lifetime specifier of the LayerTile returned by the get_tile methods.
Previously, the LayerTile returned by these methods would have the elided lifetime of "self", which is shorter than 'map.

@aleokdev
Copy link
Contributor

Argh, not the first time it has happened. Thanks!

@aleokdev aleokdev merged commit 4f1a930 into mapeditor:current Feb 19, 2023
@bjorn
Copy link
Member

bjorn commented Feb 21, 2023

Just wondering, but aren't these the kind of errors the Rust compiler is supposed to be able to notice? Or is this patch triggered by compiler errors, in usage that our tests and examples aren't covering so far?

@aleokdev
Copy link
Contributor

Both lifetimes are valid, but 'map lasts longer than 'self. There are no tests for it so the compiler accepts it.

@aleokdev
Copy link
Contributor

I forgor to check the changelog again 💀

@bjorn
Copy link
Member

bjorn commented Feb 21, 2023

Ah, so the lifetime was valid, but shorter than it could be, and for convenience we'd want the lifetime to be as long as possible.

@aleokdev
Copy link
Contributor

Yup, just like in #201.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants