From 9af4d6a2e00b51a154ef3435ccaa33bb88817a6f Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Wed, 21 Nov 2018 19:38:14 -0700 Subject: [PATCH] Fix compilation of graphical_debug feature and remove live feature warnings. --- src/arch/x86_64/graphical_debug/display.rs | 4 ++-- src/scheme/live.rs | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/arch/x86_64/graphical_debug/display.rs b/src/arch/x86_64/graphical_debug/display.rs index 9a13075..682c56e 100644 --- a/src/arch/x86_64/graphical_debug/display.rs +++ b/src/arch/x86_64/graphical_debug/display.rs @@ -1,4 +1,4 @@ -use core::alloc::{Alloc, GlobalAlloc, Layout}; +use core::alloc::{GlobalAlloc, Layout}; use core::{cmp, slice}; use super::FONT; @@ -15,7 +15,7 @@ pub struct Display { impl Display { pub fn new(width: usize, height: usize, onscreen: usize) -> Display { let size = width * height; - let offscreen = unsafe { ::ALLOCATOR.alloc(Layout::from_size_align_unchecked(size * 4, 4096)).unwrap() }; + let offscreen = unsafe { ::ALLOCATOR.alloc(Layout::from_size_align_unchecked(size * 4, 4096)) }; unsafe { fast_set64(offscreen as *mut u64, 0, size/2) }; Display { width: width, diff --git a/src/scheme/live.rs b/src/scheme/live.rs index 4352e93..fec8371 100644 --- a/src/scheme/live.rs +++ b/src/scheme/live.rs @@ -66,7 +66,7 @@ impl Scheme for DiskScheme { fn read(&self, id: usize, buffer: &mut [u8]) -> Result { let mut handles = self.handles.write(); - let mut handle = handles.get_mut(&id).ok_or(Error::new(EBADF))?; + let handle = handles.get_mut(&id).ok_or(Error::new(EBADF))?; let data = handle.data.read(); let mut i = 0; @@ -81,7 +81,7 @@ impl Scheme for DiskScheme { fn write(&self, id: usize, buffer: &[u8]) -> Result { let mut handles = self.handles.write(); - let mut handle = handles.get_mut(&id).ok_or(Error::new(EBADF))?; + let handle = handles.get_mut(&id).ok_or(Error::new(EBADF))?; let mut data = handle.data.write(); let mut i = 0; @@ -96,7 +96,7 @@ impl Scheme for DiskScheme { fn seek(&self, id: usize, pos: usize, whence: usize) -> Result { let mut handles = self.handles.write(); - let mut handle = handles.get_mut(&id).ok_or(Error::new(EBADF))?; + let handle = handles.get_mut(&id).ok_or(Error::new(EBADF))?; let data = handle.data.read(); handle.seek = match whence {