From 7c5107921db0315a48edc2510b7522e1cbf30ac5 Mon Sep 17 00:00:00 2001 From: Ryan Kennedy Date: Sun, 15 Mar 2020 18:07:01 -0500 Subject: [PATCH] Clippy --- src/colors.rs | 1 + src/registers.rs | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/colors.rs b/src/colors.rs index 2757844..1fa325e 100644 --- a/src/colors.rs +++ b/src/colors.rs @@ -1,5 +1,6 @@ //! Common color structures used in vga. +/// Represents the size of the vga palette in bytes. pub const PALETTE_SIZE: usize = 768; /// Represents a 16 bit color used for vga display. diff --git a/src/registers.rs b/src/registers.rs index 4aa5a76..debfeb1 100644 --- a/src/registers.rs +++ b/src/registers.rs @@ -426,9 +426,9 @@ impl ColorPaletteRegisters { unsafe { self.index_read_port.write(0); } - for i in 0..PALETTE_SIZE { + for byte in palette.iter_mut().take(PALETTE_SIZE) { unsafe { - palette[i] = self.data_port.read(); + *byte = self.data_port.read(); } } }