mirror of
https://github.com/emilk/egui.git
synced 2026-08-29 04:40:03 -04:00
Make FrameCache::get return a reference instead of cloning the cached value (#7834)
This is a breaking change. - Enables using `FrameCache` in cases where the cached value cannot be cloned. - Improves use cases where only a reference to the cached value is needed. - If the user needs an owned value, they can clone it themselves. Adding a `get_ref` method instead of changing `get` would avoid the breaking change, but I didn't want to do so because it is kind of expected for `get` to return `&V` when querying a collection.
This commit is contained in:
committed by
GitHub
parent
a9e92525c0
commit
7fb4627dad
@@ -116,6 +116,7 @@ fn highlight_inner(
|
||||
mem.caches
|
||||
.cache::<HighlightCache>()
|
||||
.get((&font_id, theme, code, language, settings))
|
||||
.clone()
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user