Przeglądaj źródła

Fixing future compiler error "unaligned_references" (82523)

Philipp Schuster 3 lat temu
rodzic
commit
60d900b426
1 zmienionych plików z 39 dodań i 43 usunięć
  1. 39 43
      src/vbe_info.rs

+ 39 - 43
src/vbe_info.rs

@@ -86,20 +86,18 @@ pub struct VBEControlInfo {
 
 impl fmt::Debug for VBEControlInfo {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
-        unsafe {
-            f.debug_struct("VBEControlInfo")
-                .field("signature", &self.signature)
-                .field("version", &self.version)
-                .field("oem_string_ptr", &self.oem_string_ptr)
-                .field("capabilities", &self.capabilities)
-                .field("mode_list_ptr", &self.mode_list_ptr)
-                .field("total_memory", &self.total_memory)
-                .field("oem_software_revision", &self.oem_software_revision)
-                .field("oem_vendor_name_ptr", &self.oem_vendor_name_ptr)
-                .field("oem_product_name_ptr", &self.oem_product_name_ptr)
-                .field("oem_product_revision_ptr", &self.oem_product_revision_ptr)
-                .finish()
-        }
+        f.debug_struct("VBEControlInfo")
+            .field("signature", &self.signature)
+            .field("version", &{self.version})
+            .field("oem_string_ptr", &{self.oem_string_ptr})
+            .field("capabilities", &{self.capabilities})
+            .field("mode_list_ptr", &{self.mode_list_ptr})
+            .field("total_memory", &{self.total_memory})
+            .field("oem_software_revision", &{self.oem_software_revision})
+            .field("oem_vendor_name_ptr", &{self.oem_vendor_name_ptr})
+            .field("oem_product_name_ptr", &{self.oem_product_name_ptr})
+            .field("oem_product_revision_ptr", &{self.oem_product_revision_ptr})
+            .finish()
     }
 }
 
@@ -200,35 +198,33 @@ pub struct VBEModeInfo {
 
 impl fmt::Debug for VBEModeInfo {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
-        unsafe {
-            f.debug_struct("VBEModeInfo")
-                .field("mode_attributes", &self.mode_attributes)
-                .field("window_a_attributes", &self.window_a_attributes)
-                .field("window_b_attributes", &self.window_b_attributes)
-                .field("window_granularity", &self.window_granularity)
-                .field("window_size", &self.window_size)
-                .field("window_a_segment", &self.window_a_segment)
-                .field("window_b_segment", &self.window_b_segment)
-                .field("window_function_ptr", &self.window_function_ptr)
-                .field("pitch", &self.pitch)
-                .field("resolution", &self.resolution)
-                .field("character_size", &self.character_size)
-                .field("number_of_planes", &self.number_of_planes)
-                .field("bpp", &self.bpp)
-                .field("number_of_banks", &self.number_of_banks)
-                .field("memory_model", &self.memory_model)
-                .field("bank_size", &self.bank_size)
-                .field("number_of_image_pages", &self.number_of_image_pages)
-                .field("red_field", &self.red_field)
-                .field("green_field", &self.green_field)
-                .field("blue_field", &self.blue_field)
-                .field("reserved_field", &self.reserved_field)
-                .field("direct_color_attributes", &self.direct_color_attributes)
-                .field("framebuffer_base_ptr", &self.framebuffer_base_ptr)
-                .field("offscreen_memory_offset", &self.offscreen_memory_offset)
-                .field("offscreen_memory_size", &self.offscreen_memory_size)
-                .finish()
-        }
+        f.debug_struct("VBEModeInfo")
+            .field("mode_attributes", &{self.mode_attributes})
+            .field("window_a_attributes", &self.window_a_attributes)
+            .field("window_b_attributes", &self.window_b_attributes)
+            .field("window_granularity", &{self.window_granularity})
+            .field("window_size", &{self.window_size})
+            .field("window_a_segment", &{self.window_a_segment})
+            .field("window_b_segment", &{self.window_b_segment})
+            .field("window_function_ptr", &{self.window_function_ptr})
+            .field("pitch", &{self.pitch})
+            .field("resolution", &{self.resolution})
+            .field("character_size", &self.character_size)
+            .field("number_of_planes", &self.number_of_planes)
+            .field("bpp", &self.bpp)
+            .field("number_of_banks", &self.number_of_banks)
+            .field("memory_model", &self.memory_model)
+            .field("bank_size", &self.bank_size)
+            .field("number_of_image_pages", &self.number_of_image_pages)
+            .field("red_field", &self.red_field)
+            .field("green_field", &self.green_field)
+            .field("blue_field", &self.blue_field)
+            .field("reserved_field", &self.reserved_field)
+            .field("direct_color_attributes", &self.direct_color_attributes)
+            .field("framebuffer_base_ptr", &{self.framebuffer_base_ptr})
+            .field("offscreen_memory_offset", &{self.offscreen_memory_offset})
+            .field("offscreen_memory_size", &{self.offscreen_memory_size})
+            .finish()
     }
 }