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

eframe::Frame::info returns a reference #3301

Merged
merged 6 commits into from
Sep 5, 2023
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions crates/eframe/src/epi/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -774,6 +774,11 @@ impl Frame {
self.info.clone()
}

/// Get `IntegrationInfo` as a reference.
pub fn info_ref(&self) -> &IntegrationInfo {
&self.info
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's just change the old function to return a reference instead. Users can just call .clone() themselves.


/// A place where you can store custom data in a way that persists when you restart the app.
pub fn storage(&self) -> Option<&dyn Storage> {
self.storage.as_deref()
Expand Down