mirror of
https://github.com/emilk/egui.git
synced 2026-09-02 06:40:06 -04:00
Use explicit Arc::clone to clarify when clones are cheap (#7784)
This commit is contained in:
@@ -75,7 +75,7 @@ impl WebP {
|
||||
|
||||
fn get_image(&self, frame_index: usize) -> Arc<ColorImage> {
|
||||
match self {
|
||||
Self::Static(image) => image.clone(),
|
||||
Self::Static(image) => Arc::clone(image),
|
||||
Self::Animated(animation) => animation.get_image_by_index(frame_index),
|
||||
}
|
||||
}
|
||||
@@ -108,7 +108,7 @@ impl AnimatedImage {
|
||||
}
|
||||
|
||||
pub fn get_image_by_index(&self, index: usize) -> Arc<ColorImage> {
|
||||
self.frames[index % self.frames.len()].clone()
|
||||
Arc::clone(&self.frames[index % self.frames.len()])
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user