Remove .unwrap() shit
This commit is contained in:
		
							parent
							
								
									e4001c99c7
								
							
						
					
					
						commit
						194d6f5df2
					
				
							
								
								
									
										12
									
								
								src/main.rs
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								src/main.rs
									
									
									
									
									
								
							@ -29,9 +29,15 @@ fn parse_config(conf: String, pool: &mut Vec<robot::Robot>) -> Result<world::Wor
 | 
				
			|||||||
        Some(raw) => raw,
 | 
					        Some(raw) => raw,
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
    let mut tokens = raw_line.split_whitespace();
 | 
					    let mut tokens = raw_line.split_whitespace();
 | 
				
			||||||
    let token1 = tokens.next();
 | 
					    let token1 = match tokens.next() {
 | 
				
			||||||
    let token2 = tokens.next();
 | 
					        None => return Err("Could not read the first token of the first line !"),
 | 
				
			||||||
    println!("{}, {}", token1.unwrap(), token2.unwrap());
 | 
					        Some(raw) => raw,
 | 
				
			||||||
 | 
					    };
 | 
				
			||||||
 | 
					    let token2 = match tokens.next() {
 | 
				
			||||||
 | 
					        None => return Err("Could not read the second token of the first line !"),
 | 
				
			||||||
 | 
					        Some(raw) => raw,
 | 
				
			||||||
 | 
					    };
 | 
				
			||||||
 | 
					    println!("{}, {}", token1, token2);
 | 
				
			||||||
    Ok(world::World { x: 5, y: 5 })
 | 
					    Ok(world::World { x: 5, y: 5 })
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user