mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 11:45:50 +02:00
Last unwraps (#1160)
* Work through most of the last unwraps * Finish removing unwraps
This commit is contained in:
@ -34,8 +34,20 @@ impl PrettyDebug for Unit {
|
||||
|
||||
fn convert_number_to_u64(number: &Number) -> u64 {
|
||||
match number {
|
||||
Number::Int(big_int) => big_int.to_u64().unwrap(),
|
||||
Number::Decimal(big_decimal) => big_decimal.to_u64().unwrap(),
|
||||
Number::Int(big_int) => {
|
||||
if let Some(x) = big_int.to_u64() {
|
||||
x
|
||||
} else {
|
||||
unreachable!("Internal error: convert_number_to_u64 given incompatible number")
|
||||
}
|
||||
}
|
||||
Number::Decimal(big_decimal) => {
|
||||
if let Some(x) = big_decimal.to_u64() {
|
||||
x
|
||||
} else {
|
||||
unreachable!("Internal error: convert_number_to_u64 given incompatible number")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user