1
1
mirror of https://github.com/theoludwig/programming-challenges.git synced 2025-05-18 12:02:53 +02:00

fix: avoid usage of .unwrap in Rust solutions

This commit is contained in:
2023-08-21 22:45:05 +02:00
parent 5b3048f305
commit 2386ea012d
8 changed files with 38 additions and 15 deletions

View File

@ -22,12 +22,12 @@ fn main() {
.get(0)
.expect("Couldn't get `quantity_per_cake`.")
.parse()
.unwrap();
.expect("Failed to convert `quantity_per_cake` as an `u32`.");
let quantity_available: u32 = line_integers
.get(1)
.expect("Couldn't get `quantity_available`.")
.parse()
.unwrap();
.expect("Failed to convert `quantity_available` as an `u32`.");
let cake_possible = quantity_available / quantity_per_cake;
if let Some(value) = maximum_number_of_cake_possible {