File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
arch/x86_64/graphical_debug Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change 1
- use core:: alloc:: { Alloc , GlobalAlloc , Layout } ;
1
+ use core:: alloc:: { GlobalAlloc , Layout } ;
2
2
use core:: { cmp, slice} ;
3
3
4
4
use super :: FONT ;
@@ -15,7 +15,7 @@ pub struct Display {
15
15
impl Display {
16
16
pub fn new ( width : usize , height : usize , onscreen : usize ) -> Display {
17
17
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 ) ) } ;
19
19
unsafe { fast_set64 ( offscreen as * mut u64 , 0 , size/2 ) } ;
20
20
Display {
21
21
width : width,
Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ impl Scheme for DiskScheme {
66
66
67
67
fn read ( & self , id : usize , buffer : & mut [ u8 ] ) -> Result < usize > {
68
68
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 ) ) ?;
70
70
let data = handle. data . read ( ) ;
71
71
72
72
let mut i = 0 ;
@@ -81,7 +81,7 @@ impl Scheme for DiskScheme {
81
81
82
82
fn write ( & self , id : usize , buffer : & [ u8 ] ) -> Result < usize > {
83
83
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 ) ) ?;
85
85
let mut data = handle. data . write ( ) ;
86
86
87
87
let mut i = 0 ;
@@ -96,7 +96,7 @@ impl Scheme for DiskScheme {
96
96
97
97
fn seek ( & self , id : usize , pos : usize , whence : usize ) -> Result < usize > {
98
98
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 ) ) ?;
100
100
let data = handle. data . read ( ) ;
101
101
102
102
handle. seek = match whence {
You can’t perform that action at this time.
0 commit comments