Skip to content

Commit f8a4e3f

Browse files
committed
Panic when invalid overflow value is returned
1 parent b78e956 commit f8a4e3f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: src/int/mul.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ mod tests {
102102
let mut overflow = 2;
103103
let r = f(a, b, &mut overflow);
104104
if overflow != 0 && overflow != 1 {
105-
return None
105+
panic!("Invalid value {} for overflow", overflow);
106106
}
107107
Some((r, overflow))
108108
}
@@ -114,7 +114,7 @@ mod tests {
114114
let mut overflow = 2;
115115
let r = f(a, b, &mut overflow);
116116
if overflow != 0 && overflow != 1 {
117-
return None
117+
panic!("Invalid value {} for overflow", overflow);
118118
}
119119
Some((r, overflow))
120120
}
@@ -138,7 +138,7 @@ mod tests_i128 {
138138
let mut overflow = 2;
139139
let r = f(a, b, &mut overflow);
140140
if overflow != 0 && overflow != 1 {
141-
return None
141+
panic!("Invalid value {} for overflow", overflow);
142142
}
143143
Some((r, overflow))
144144
}

0 commit comments

Comments
 (0)