@@ -66,6 +66,7 @@ impl App {
6666 let Some ( ( window, _) ) = self . window . as_mut ( ) else {
6767 return ;
6868 } ;
69+ #[ expect( clippy:: as_conversions, reason = "casting f64 to u32" ) ]
6970 let scale_factor = ( window. scale_factor ( ) * 100.0 ) as u32 ;
7071
7172 let width = u16:: try_from ( size. width ) . expect ( "reasonable width" ) ;
@@ -222,8 +223,10 @@ impl ApplicationHandler<RdpOutputEvent> for App {
222223 }
223224 WindowEvent :: CursorMoved { position, .. } => {
224225 let win_size = window. inner_size ( ) ;
225- let x = ( position. x / win_size. width as f64 * self . buffer_size . 0 as f64 ) as u16 ;
226- let y = ( position. y / win_size. height as f64 * self . buffer_size . 1 as f64 ) as u16 ;
226+ #[ expect( clippy:: as_conversions, reason = "casting f64 to u16" ) ]
227+ let x = ( position. x / f64:: from ( win_size. width ) * f64:: from ( self . buffer_size . 0 ) ) as u16 ;
228+ #[ expect( clippy:: as_conversions, reason = "casting f64 to u16" ) ]
229+ let y = ( position. y / f64:: from ( win_size. height ) * f64:: from ( self . buffer_size . 1 ) ) as u16 ;
227230 let operation = ironrdp:: input:: Operation :: MouseMove ( ironrdp:: input:: MousePosition { x, y } ) ;
228231
229232 let input_events = self . input_database . apply ( core:: iter:: once ( operation) ) ;
@@ -239,6 +242,7 @@ impl ApplicationHandler<RdpOutputEvent> for App {
239242 operations. push ( ironrdp:: input:: Operation :: WheelRotations (
240243 ironrdp:: input:: WheelRotations {
241244 is_vertical : false ,
245+ #[ expect( clippy:: as_conversions, reason = "casting f32 to i16" ) ]
242246 rotation_units : ( delta_x * 100. ) as i16 ,
243247 } ,
244248 ) ) ;
@@ -248,6 +252,7 @@ impl ApplicationHandler<RdpOutputEvent> for App {
248252 operations. push ( ironrdp:: input:: Operation :: WheelRotations (
249253 ironrdp:: input:: WheelRotations {
250254 is_vertical : true ,
255+ #[ expect( clippy:: as_conversions, reason = "casting f32 to i16" ) ]
251256 rotation_units : ( delta_y * 100. ) as i16 ,
252257 } ,
253258 ) ) ;
@@ -258,6 +263,7 @@ impl ApplicationHandler<RdpOutputEvent> for App {
258263 operations. push ( ironrdp:: input:: Operation :: WheelRotations (
259264 ironrdp:: input:: WheelRotations {
260265 is_vertical : false ,
266+ #[ expect( clippy:: as_conversions, reason = "casting f64 to i16" ) ]
261267 rotation_units : delta. x as i16 ,
262268 } ,
263269 ) ) ;
@@ -267,6 +273,7 @@ impl ApplicationHandler<RdpOutputEvent> for App {
267273 operations. push ( ironrdp:: input:: Operation :: WheelRotations (
268274 ironrdp:: input:: WheelRotations {
269275 is_vertical : true ,
276+ #[ expect( clippy:: as_conversions, reason = "casting f64 to i16" ) ]
270277 rotation_units : delta. y as i16 ,
271278 } ,
272279 ) ) ;
0 commit comments