Fix clippy warnings
This commit is contained in:
		
							parent
							
								
									686ceb88da
								
							
						
					
					
						commit
						4c213db5fb
					
				|  | @ -78,6 +78,7 @@ pub struct Win32Source { | ||||||
|   callback: LazyCell<Win32SourceCallback>, |   callback: LazyCell<Win32SourceCallback>, | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | #[allow(clippy::new_without_default)] | ||||||
| impl Win32Source { | impl Win32Source { | ||||||
|   pub fn new() -> Win32Source { |   pub fn new() -> Win32Source { | ||||||
|     Self { |     Self { | ||||||
|  | @ -101,7 +102,7 @@ impl Win32Source { | ||||||
|       panic!("Attempt to start Win32Source eventloop without initialization"); |       panic!("Attempt to start Win32Source eventloop without initialization"); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     if let Err(_) = self.callback.fill(event_callback) { |     if self.callback.fill(event_callback).is_err() { | ||||||
|       panic!("Unable to set Win32Source event callback"); |       panic!("Unable to set Win32Source event callback"); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -127,10 +127,10 @@ impl Win32EventLoop { | ||||||
|     // Convert the icon paths to the raw representation
 |     // Convert the icon paths to the raw representation
 | ||||||
|     let mut icon_paths: [[u16; MAX_FILE_PATH]; MAX_ICON_COUNT] = |     let mut icon_paths: [[u16; MAX_FILE_PATH]; MAX_ICON_COUNT] = | ||||||
|       [[0; MAX_FILE_PATH]; MAX_ICON_COUNT]; |       [[0; MAX_FILE_PATH]; MAX_ICON_COUNT]; | ||||||
|     for i in 0..self.icons.len() { |     for (i, icon_path) in icon_paths.iter_mut().enumerate().take(self.icons.len()) { | ||||||
|       let wide_path = WideString::from_str(&self.icons[i]); |       let wide_path = WideString::from_str(&self.icons[i]); | ||||||
|       let len = min(wide_path.len(), MAX_FILE_PATH - 1); |       let len = min(wide_path.len(), MAX_FILE_PATH - 1); | ||||||
|       icon_paths[i][0..len].clone_from_slice(&wide_path.as_slice()[..len]); |       icon_path[0..len].clone_from_slice(&wide_path.as_slice()[..len]); | ||||||
|       // TODO: test overflow, correct case
 |       // TODO: test overflow, correct case
 | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  | @ -170,7 +170,7 @@ impl Win32EventLoop { | ||||||
|       // TODO: test
 |       // TODO: test
 | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     if let Err(_) = self._event_callback.fill(event_callback) { |     if self._event_callback.fill(event_callback).is_err() { | ||||||
|       panic!("Unable to set Win32EventLoop callback"); |       panic!("Unable to set Win32EventLoop callback"); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  | @ -238,11 +238,11 @@ impl Win32Remote { | ||||||
|       unsafe { ui_update_tray_icon(handle, (*index) as i32) } |       unsafe { ui_update_tray_icon(handle, (*index) as i32) } | ||||||
|     } else { |     } else { | ||||||
|       error!("Unable to update tray icon, invalid icon id"); |       error!("Unable to update tray icon, invalid icon id"); | ||||||
|       return; |  | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | #[allow(clippy::single_match)] // TODO: remove after another match is used
 | ||||||
| impl From<RawUIEvent> for Option<UIEvent> { | impl From<RawUIEvent> for Option<UIEvent> { | ||||||
|   fn from(raw: RawUIEvent) -> Option<UIEvent> { |   fn from(raw: RawUIEvent) -> Option<UIEvent> { | ||||||
|     match raw.event_type { |     match raw.event_type { | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user