| 
						
						
							
								
							
						
						
					 | 
					 | 
					@ -40,8 +40,11 @@ where | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    TS: std::fmt::Display + Sized, | 
					 | 
					 | 
					 | 
					    TS: std::fmt::Display + Sized, | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					{ | 
					 | 
					 | 
					 | 
					{ | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    let mut map: std::collections::HashMap<String, &TS> = std::collections::HashMap::new(); | 
					 | 
					 | 
					 | 
					    let mut map: std::collections::HashMap<String, &TS> = std::collections::HashMap::new(); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					    let mut strs: Vec<String> = vec![]; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    for c in choices { | 
					 | 
					 | 
					 | 
					    for c in choices { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        map.insert(format!("{}", c), c); | 
					 | 
					 | 
					 | 
					        let s = format!("{}", c); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        strs.push(String::from(s.as_str())); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        map.insert(s, c); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    } | 
					 | 
					 | 
					 | 
					    } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    let mut wofi = proc::Command::new("wofi") | 
					 | 
					 | 
					 | 
					    let mut wofi = proc::Command::new("wofi") | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -58,12 +61,12 @@ where | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    { | 
					 | 
					 | 
					 | 
					    { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        let stdin = wofi.stdin.as_mut().expect("Failed to open wofi stdin"); | 
					 | 
					 | 
					 | 
					        let stdin = wofi.stdin.as_mut().expect("Failed to open wofi stdin"); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        for c in choices { | 
					 | 
					 | 
					 | 
					        let wofi_input = strs.join("\n"); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        println!("Wofi input:\n{}", wofi_input); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        stdin | 
					 | 
					 | 
					 | 
					        stdin | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                .write_all(format!("{}\n", c).as_bytes()) | 
					 | 
					 | 
					 | 
					            .write_all(wofi_input.as_bytes()) | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            .expect("Failed to write to wofi stdin"); | 
					 | 
					 | 
					 | 
					            .expect("Failed to write to wofi stdin"); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    } | 
					 | 
					 | 
					 | 
					    } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    } | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    let output = wofi.wait_with_output().expect("Failed to read stdout"); | 
					 | 
					 | 
					 | 
					    let output = wofi.wait_with_output().expect("Failed to read stdout"); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    let choice = String::from_utf8_lossy(&output.stdout); | 
					 | 
					 | 
					 | 
					    let choice = String::from_utf8_lossy(&output.stdout); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					 | 
					
  |