Skip to content

unwrap() instead of ? in recursive calls in decorator_storage and debug_var_storage #2785

@johnh4098

Description

@johnh4098

Packages versions

next branch

Bug description

Found two spots where a Result-returning function uses .unwrap() on a
recursive call to itself, while using ? everywhere else in the same function.

decorator_storage.rs line 403:
self.add_decorator_info_for_node(MastNodeId::new_unchecked(idx), vec![])
.unwrap();

debug_var_storage.rs line 335:
self.add_debug_var_info_for_node(MastNodeId::new_unchecked(idx), vec![])
.unwrap();

Both functions return Result<(), DecoratorIndexError> and use map_err(...)?
for all other error paths. These two recursive calls are the only places
that panic instead of propagating the error up to the caller.

Fix is straightforward - replace .unwrap() with ? in both locations.
Happy to send a PR if this can be assigned.

How can this be reproduced?

No response

Relevant log output

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions