Appease clippy
This commit is contained in:
		
							parent
							
								
									b6b0a8c22b
								
							
						
					
					
						commit
						065f68e9a8
					
				| 
						 | 
					@ -12,7 +12,7 @@ impl RegisterInfo {
 | 
				
			||||||
    pub fn to_description(&self) -> String {
 | 
					    pub fn to_description(&self) -> String {
 | 
				
			||||||
        let mut string = format!("name:{}", self.name);
 | 
					        let mut string = format!("name:{}", self.name);
 | 
				
			||||||
        if let Some(alt) = self.alt_name {
 | 
					        if let Some(alt) = self.alt_name {
 | 
				
			||||||
            string.push_str(&format!(";alt-name:{}", alt));
 | 
					            string.push_str(&format!(";alt-name:{alt}"));
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        string.push_str(&format!(
 | 
					        string.push_str(&format!(
 | 
				
			||||||
            ";bitsize:32;offset:{};encoding:uint;format:hex;set:{};dwarf:{}",
 | 
					            ";bitsize:32;offset:{};encoding:uint;format:hex;set:{};dwarf:{}",
 | 
				
			||||||
| 
						 | 
					@ -21,7 +21,7 @@ impl RegisterInfo {
 | 
				
			||||||
            self.dwarf
 | 
					            self.dwarf
 | 
				
			||||||
        ));
 | 
					        ));
 | 
				
			||||||
        if let Some(generic) = self.generic {
 | 
					        if let Some(generic) = self.generic {
 | 
				
			||||||
            string.push_str(&format!(";generic:{}", generic));
 | 
					            string.push_str(&format!(";generic:{generic}"));
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        string
 | 
					        string
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -227,7 +227,7 @@ impl Mappings for InputMapping {
 | 
				
			||||||
        for (keyboard_key, keys) in &self.keys {
 | 
					        for (keyboard_key, keys) in &self.keys {
 | 
				
			||||||
            let name = match keyboard_key {
 | 
					            let name = match keyboard_key {
 | 
				
			||||||
                PhysicalKey::Code(code) => format!("{code:?}"),
 | 
					                PhysicalKey::Code(code) => format!("{code:?}"),
 | 
				
			||||||
                k => format!("{:?}", k),
 | 
					                k => format!("{k:?}"),
 | 
				
			||||||
            };
 | 
					            };
 | 
				
			||||||
            for key in keys.iter() {
 | 
					            for key in keys.iter() {
 | 
				
			||||||
                results.entry(key).or_default().push(name.clone());
 | 
					                results.entry(key).or_default().push(name.clone());
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										10
									
								
								src/main.rs
								
								
								
								
							
							
						
						
									
										10
									
								
								src/main.rs
								
								
								
								
							| 
						 | 
					@ -44,9 +44,9 @@ fn set_panic_handler() {
 | 
				
			||||||
    std::panic::set_hook(Box::new(|info| {
 | 
					    std::panic::set_hook(Box::new(|info| {
 | 
				
			||||||
        let mut message = String::new();
 | 
					        let mut message = String::new();
 | 
				
			||||||
        if let Some(msg) = info.payload().downcast_ref::<&str>() {
 | 
					        if let Some(msg) = info.payload().downcast_ref::<&str>() {
 | 
				
			||||||
            message += &format!("{}\n", msg);
 | 
					            message += &format!("{msg}\n");
 | 
				
			||||||
        } else if let Some(msg) = info.payload().downcast_ref::<String>() {
 | 
					        } else if let Some(msg) = info.payload().downcast_ref::<String>() {
 | 
				
			||||||
            message += &format!("{}\n", msg);
 | 
					            message += &format!("{msg}\n");
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        if let Some(location) = info.location() {
 | 
					        if let Some(location) = info.location() {
 | 
				
			||||||
            message += &format!(
 | 
					            message += &format!(
 | 
				
			||||||
| 
						 | 
					@ -56,9 +56,9 @@ fn set_panic_handler() {
 | 
				
			||||||
            );
 | 
					            );
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        let backtrace = std::backtrace::Backtrace::force_capture();
 | 
					        let backtrace = std::backtrace::Backtrace::force_capture();
 | 
				
			||||||
        message += &format!("stack trace:\n{:#}\n", backtrace);
 | 
					        message += &format!("stack trace:\n{backtrace:#}\n");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        eprint!("{}", message);
 | 
					        eprint!("{message}");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        let Some(project_dirs) = directories::ProjectDirs::from("com", "virtual-boy", "Lemur")
 | 
					        let Some(project_dirs) = directories::ProjectDirs::from("com", "virtual-boy", "Lemur")
 | 
				
			||||||
        else {
 | 
					        else {
 | 
				
			||||||
| 
						 | 
					@ -72,7 +72,7 @@ fn set_panic_handler() {
 | 
				
			||||||
            .duration_since(SystemTime::UNIX_EPOCH)
 | 
					            .duration_since(SystemTime::UNIX_EPOCH)
 | 
				
			||||||
            .unwrap()
 | 
					            .unwrap()
 | 
				
			||||||
            .as_millis();
 | 
					            .as_millis();
 | 
				
			||||||
        let logfile_name = format!("crash-{}.txt", timestamp);
 | 
					        let logfile_name = format!("crash-{timestamp}.txt");
 | 
				
			||||||
        let _ = std::fs::write(data_dir.join(logfile_name), message);
 | 
					        let _ = std::fs::write(data_dir.join(logfile_name), message);
 | 
				
			||||||
    }));
 | 
					    }));
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue