remove unsafe unwrap in put_char (#1881)
This commit is contained in:
@@ -3102,9 +3102,10 @@ impl Machine {
|
|||||||
} else {
|
} else {
|
||||||
read_heap_cell!(addr,
|
read_heap_cell!(addr,
|
||||||
(HeapCellValueTag::Atom, (name, _arity)) => {
|
(HeapCellValueTag::Atom, (name, _arity)) => {
|
||||||
let c = name.as_char().unwrap();
|
if let Some(c) = name.as_char() {
|
||||||
write!(&mut stream, "{}", c).unwrap();
|
write!(&mut stream, "{}", c).unwrap();
|
||||||
return Ok(());
|
return Ok(());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
(HeapCellValueTag::Char, c) => {
|
(HeapCellValueTag::Char, c) => {
|
||||||
write!(&mut stream, "{}", c).unwrap();
|
write!(&mut stream, "{}", c).unwrap();
|
||||||
|
|||||||
Reference in New Issue
Block a user