1
0
mirror of https://github.com/emilk/egui.git synced 2026-09-03 07:10:04 -04:00

cargo fmt

This commit is contained in:
Emil Ernerfeldt
2025-04-01 18:41:39 +02:00
parent ff9dfdeec1
commit 6a5f6d3f86

View File

@@ -776,7 +776,9 @@ impl GalleyCache {
let hash = crate::util::hash(&job); // TODO(emilk): even faster hasher?
(hash, match self.cache.entry(hash) {
(
hash,
match self.cache.entry(hash) {
std::collections::hash_map::Entry::Occupied(entry) => {
// The job was found in cache - no need to re-layout.
let cached = entry.into_mut();
@@ -797,13 +799,17 @@ impl GalleyCache {
let job = Arc::new(job);
if allow_split_paragraphs && should_cache_each_paragraph_individually(&job) {
let mut child_hashes = Vec::new();
let galley = self.layout_each_paragraph_individuallly(fonts, job, &mut child_hashes);
let galley =
self.layout_each_paragraph_individuallly(fonts, job, &mut child_hashes);
let galley = Arc::new(galley);
self.cache.insert(hash, CachedGalley {
self.cache.insert(
hash,
CachedGalley {
last_used: self.generation,
children: Some(child_hashes.into()),
galley: galley.clone()
});
galley: galley.clone(),
},
);
galley
} else {
let galley = super::layout(fonts, job);
@@ -816,7 +822,8 @@ impl GalleyCache {
galley
}
}
})
},
)
}
fn layout(
@@ -833,7 +840,7 @@ impl GalleyCache {
&mut self,
fonts: &mut FontsImpl,
job: Arc<LayoutJob>,
child_hashes: &mut Vec<u64>
child_hashes: &mut Vec<u64>,
) -> Galley {
profiling::function_scope!();