From b27afc46f8b0c8e1ac3a27354a3b041750565fe4 Mon Sep 17 00:00:00 2001 From: kaf-lamed-beyt Date: Sun, 15 Dec 2024 00:39:17 +0100 Subject: [PATCH] minor --- crates/image_viewer/src/image_info.rs | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/crates/image_viewer/src/image_info.rs b/crates/image_viewer/src/image_info.rs index aefe3a364c..bdaa2bd884 100644 --- a/crates/image_viewer/src/image_info.rs +++ b/crates/image_viewer/src/image_info.rs @@ -60,23 +60,18 @@ impl StatusItemView for ImageInfoView { active_pane_item: Option<&dyn ItemHandle>, cx: &mut ViewContext, ) { - // Reset fields self.width = None; self.height = None; self.file_size = None; self.color_type = None; - // Extract metadata if the item is an ImageItem if let Some(item) = active_pane_item { if let Some(image_model) = item.downcast::>() { let image_item = image_model.read(cx); - // Assign the properties - self.width = image_item.read(cx).width; // `Option` is directly assignable - self.height = image_item.read(cx).height; // `Option` is directly assignable - self.file_size = image_item.read(cx).file_size; // `Option` is directly assignable - - // Handle `color_type` + self.width = image_item.read(cx).width; + self.height = image_item.read(cx).height; + self.file_size = image_item.read(cx).file_size; self.color_type = image_item.read(cx).color_type; } }