Skip to content

Commit 9af4d6a

Browse files
committed
Fix compilation of graphical_debug feature and remove live feature warnings.
1 parent ee5c43e commit 9af4d6a

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/arch/x86_64/graphical_debug/display.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use core::alloc::{Alloc, GlobalAlloc, Layout};
1+
use core::alloc::{GlobalAlloc, Layout};
22
use core::{cmp, slice};
33

44
use super::FONT;
@@ -15,7 +15,7 @@ pub struct Display {
1515
impl Display {
1616
pub fn new(width: usize, height: usize, onscreen: usize) -> Display {
1717
let size = width * height;
18-
let offscreen = unsafe { ::ALLOCATOR.alloc(Layout::from_size_align_unchecked(size * 4, 4096)).unwrap() };
18+
let offscreen = unsafe { ::ALLOCATOR.alloc(Layout::from_size_align_unchecked(size * 4, 4096)) };
1919
unsafe { fast_set64(offscreen as *mut u64, 0, size/2) };
2020
Display {
2121
width: width,

src/scheme/live.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ impl Scheme for DiskScheme {
6666

6767
fn read(&self, id: usize, buffer: &mut [u8]) -> Result<usize> {
6868
let mut handles = self.handles.write();
69-
let mut handle = handles.get_mut(&id).ok_or(Error::new(EBADF))?;
69+
let handle = handles.get_mut(&id).ok_or(Error::new(EBADF))?;
7070
let data = handle.data.read();
7171

7272
let mut i = 0;
@@ -81,7 +81,7 @@ impl Scheme for DiskScheme {
8181

8282
fn write(&self, id: usize, buffer: &[u8]) -> Result<usize> {
8383
let mut handles = self.handles.write();
84-
let mut handle = handles.get_mut(&id).ok_or(Error::new(EBADF))?;
84+
let handle = handles.get_mut(&id).ok_or(Error::new(EBADF))?;
8585
let mut data = handle.data.write();
8686

8787
let mut i = 0;
@@ -96,7 +96,7 @@ impl Scheme for DiskScheme {
9696

9797
fn seek(&self, id: usize, pos: usize, whence: usize) -> Result<usize> {
9898
let mut handles = self.handles.write();
99-
let mut handle = handles.get_mut(&id).ok_or(Error::new(EBADF))?;
99+
let handle = handles.get_mut(&id).ok_or(Error::new(EBADF))?;
100100
let data = handle.data.read();
101101

102102
handle.seek = match whence {

0 commit comments

Comments
 (0)