error handling in main
This commit is contained in:
		
							parent
							
								
									ec01c0c1d4
								
							
						
					
					
						commit
						015a8a33ae
					
				@ -64,9 +64,10 @@ fn open_file(filename: &str) -> io::Result<String> {
 | 
				
			|||||||
    Ok(content)
 | 
					    Ok(content)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
fn main() {
 | 
					fn main() -> Result<(), Box<dyn std::error::Error>> {
 | 
				
			||||||
    let mut robot_pool: Vec<Robot> = Vec::new();
 | 
					    let mut robot_pool: Vec<Robot> = Vec::new();
 | 
				
			||||||
    let raw_conf = open_file("two_robots.txt");
 | 
					    let raw_conf = open_file("two_robots.txt")?;
 | 
				
			||||||
 | 
					    Ok(())
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#[cfg(test)]
 | 
					#[cfg(test)]
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user