clean up error messages
This commit is contained in:
		
							parent
							
								
									b868a7978b
								
							
						
					
					
						commit
						6b308fc71e
					
				@ -78,7 +78,7 @@ fn parse_config(conf: String, pool: &mut Vec<robot::Robot>) -> Result<world::Wor
 | 
			
		||||
    let mut lines: Vec<&str> = conf.split('\n').collect();
 | 
			
		||||
    let raw_world = match ConfParser::parse(Rule::world, lines.remove(0)) {
 | 
			
		||||
        Ok(s) => s.as_str(),
 | 
			
		||||
        Err(e) => return Err(format!("{}", e)),
 | 
			
		||||
        Err(e) => return Err(String::from("World config is broken.")),
 | 
			
		||||
    };
 | 
			
		||||
    let mut w: Vec<i32> = Vec::with_capacity(2);
 | 
			
		||||
    for n in raw_world.split_whitespace() {
 | 
			
		||||
@ -95,7 +95,7 @@ fn parse_config(conf: String, pool: &mut Vec<robot::Robot>) -> Result<world::Wor
 | 
			
		||||
        }
 | 
			
		||||
        let raw_setup = match ConfParser::parse(Rule::robot_init, lines.remove(0)) {
 | 
			
		||||
            Ok(s) => s.as_str(),
 | 
			
		||||
            Err(e) => return Err(format!("{}", e)),
 | 
			
		||||
            Err(e) => return Err(String::from("Robot setup is broken.")),
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        let rand_instructions = gen_random_instructions();
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user