diff --git a/source/roman_to_integer/mod.rs b/source/roman_to_integer/mod.rs index 4bb74ca..3af6140 100644 --- a/source/roman_to_integer/mod.rs +++ b/source/roman_to_integer/mod.rs @@ -11,7 +11,7 @@ pub fn roman_to_int(string: String) -> i32 { 'C' => 100, 'D' => 500, 'M' => 1000, - _ => panic!("Unknown character: {character}"), + _ => unreachable!(), }; if let Some(next) = characters.peek() { diff --git a/source/two_sum/mod.rs b/source/two_sum/mod.rs index ba9441a..3db3e1c 100644 --- a/source/two_sum/mod.rs +++ b/source/two_sum/mod.rs @@ -13,5 +13,5 @@ pub fn two_sum(numbers: Vec, target: i32) -> Vec { } } - panic!("No pair of numbers found that sum to {}", target) + unreachable!() } diff --git a/source/valid_parenthesis/mod.rs b/source/valid_parenthesis/mod.rs index d53c04e..e351ac2 100644 --- a/source/valid_parenthesis/mod.rs +++ b/source/valid_parenthesis/mod.rs @@ -10,7 +10,7 @@ pub fn is_valid(string: String) -> bool { '[' => ']', '{' => '}', '(' => ')', - _ => panic!("Invalid input character: {character}"), + _ => unreachable!(), } }