File tree Expand file tree Collapse file tree 3 files changed +7
-7
lines changed Expand file tree Collapse file tree 3 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ impl KeyHandler {
47
47
for ( idx, is_down) in self . keys . iter ( ) . enumerate ( ) {
48
48
if * is_down {
49
49
unsafe {
50
- keys. push ( std:: mem:: transmute ( idx as u8 ) ) ;
50
+ keys. push ( std:: mem:: transmute :: < u8 , Key > ( idx as u8 ) ) ;
51
51
}
52
52
}
53
53
}
@@ -85,7 +85,7 @@ impl KeyHandler {
85
85
for ( idx, is_down) in self . keys . iter ( ) . enumerate ( ) {
86
86
if * is_down && self . is_key_index_pressed ( idx, repeat) {
87
87
unsafe {
88
- keys. push ( std:: mem:: transmute ( idx as u8 ) ) ;
88
+ keys. push ( std:: mem:: transmute :: < u8 , Key > ( idx as u8 ) ) ;
89
89
}
90
90
}
91
91
}
@@ -99,7 +99,7 @@ impl KeyHandler {
99
99
for ( idx, is_down) in self . keys . iter ( ) . enumerate ( ) {
100
100
if !( * is_down) && self . is_key_index_released ( idx) {
101
101
unsafe {
102
- keys. push ( std:: mem:: transmute ( idx as u8 ) ) ;
102
+ keys. push ( std:: mem:: transmute :: < u8 , Key > ( idx as u8 ) ) ;
103
103
}
104
104
}
105
105
}
Original file line number Diff line number Diff line change @@ -276,7 +276,7 @@ impl DisplayInfo {
276
276
277
277
// Give the buffer to the surface and commit
278
278
surface. attach ( Some ( buffer) , 0 , 0 ) ;
279
- surface. damage ( 0 , 0 , i32:: max_value ( ) , i32:: max_value ( ) ) ;
279
+ surface. damage ( 0 , 0 , i32:: MAX , i32:: MAX ) ;
280
280
surface. commit ( ) ;
281
281
282
282
let xdg_config = Rc :: new ( RefCell :: new ( None ) ) ;
@@ -350,7 +350,7 @@ impl DisplayInfo {
350
350
let slice = unsafe {
351
351
std:: slice:: from_raw_parts (
352
352
buffer. as_ptr ( ) as * const u8 ,
353
- buffer . len ( ) * std:: mem:: size_of :: < u32 > ( ) ,
353
+ std:: mem:: size_of_val ( buffer ) ,
354
354
)
355
355
} ;
356
356
@@ -364,7 +364,7 @@ impl DisplayInfo {
364
364
365
365
self . surface . attach ( Some ( buf) , 0 , 0 ) ;
366
366
self . surface
367
- . damage ( 0 , 0 , i32:: max_value ( ) , i32:: max_value ( ) ) ;
367
+ . damage ( 0 , 0 , i32:: MAX , i32:: MAX ) ;
368
368
self . surface . commit ( ) ;
369
369
370
370
Ok ( ( ) )
Original file line number Diff line number Diff line change @@ -1200,7 +1200,7 @@ impl Window {
1200
1200
}
1201
1201
1202
1202
fn update_key_state ( & mut self , sym : xlib:: KeySym , is_down : bool ) {
1203
- if sym > u32:: max_value ( ) as xlib:: KeySym {
1203
+ if sym > u32:: MAX as xlib:: KeySym {
1204
1204
return ;
1205
1205
}
1206
1206
You can’t perform that action at this time.
0 commit comments