1
0
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:
Trương Hoàng Long
2026-01-11 16:31:58 +01:00
committed by GitHub
parent a9e92525c0
commit 7fb4627dad
4 changed files with 7 additions and 7 deletions

View File

@@ -116,6 +116,7 @@ fn highlight_inner(
mem.caches
.cache::<HighlightCache>()
.get((&font_id, theme, code, language, settings))
.clone()
})
}