Remove unwrap logic
This commit is contained in:
committed by
Nicolás Hatcher Andrés
parent
e130f784fd
commit
be6819fec3
@@ -372,16 +372,19 @@ impl Model {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
if s.len() == 0 {
|
match s.chars().next() {
|
||||||
return CalcResult::Error {
|
Some(c) => {
|
||||||
error: Error::VALUE,
|
let unicode_number = c as u32;
|
||||||
origin: cell,
|
return CalcResult::Number(unicode_number as f64);
|
||||||
message: "Empty cell".to_string(),
|
}
|
||||||
};
|
None => {
|
||||||
|
return CalcResult::Error {
|
||||||
|
error: Error::VALUE,
|
||||||
|
origin: cell,
|
||||||
|
message: "Empty cell".to_string(),
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let unicode_number = s.chars().nth(0).unwrap() as u32;
|
|
||||||
return CalcResult::Number(unicode_number as f64);
|
|
||||||
}
|
}
|
||||||
CalcResult::new_args_number_error(cell)
|
CalcResult::new_args_number_error(cell)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user