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
Notes:
sideshowbarker
2024-07-18 08:24:18 +09:00
Author: https://github.com/Lubrsi Commit: https://github.com/SerenityOS/serenity/commit/e80f8746b1e Pull-request: https://github.com/SerenityOS/serenity/pull/8826 Reviewed-by: https://github.com/MaxWipfli Reviewed-by: https://github.com/X-yl Reviewed-by: https://github.com/linusg
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>();
|
||||
|
||||
while (!try_consume("]")) {
|
||||
auto num = parse_number();
|
||||
if (num != (unsigned)-1) {
|
||||
data_item.section->parts->append(num);
|
||||
auto num = try_parse_number();
|
||||
if (num.has_value()) {
|
||||
data_item.section->parts->append(num.value());
|
||||
continue;
|
||||
}
|
||||
auto atom = parse_atom();
|
||||
|
|
Loading…
Add table
Reference in a new issue