mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 04:17:34 +00:00
LibIMAP: Use try_parse_number instead of parse_number when parsing parts
This makes it so we can use Optional instead of relying on an error number.
This commit is contained in:
parent
2c793d5935
commit
e80f8746b1
1 changed files with 3 additions and 3 deletions
|
@ -719,9 +719,9 @@ FetchCommand::DataItem Parser::parse_fetch_data_item()
|
||||||
data_item.section->parts = Vector<unsigned>();
|
data_item.section->parts = Vector<unsigned>();
|
||||||
|
|
||||||
while (!try_consume("]")) {
|
while (!try_consume("]")) {
|
||||||
auto num = parse_number();
|
auto num = try_parse_number();
|
||||||
if (num != (unsigned)-1) {
|
if (num.has_value()) {
|
||||||
data_item.section->parts->append(num);
|
data_item.section->parts->append(num.value());
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
auto atom = parse_atom();
|
auto atom = parse_atom();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue