Skip to content

Handle possible unnecessary panics by removing unwrap() calls #2

Open
@davidbtadokoro

Description

@davidbtadokoro

Context:

FWIU, the use of the unwrap() call is discouraged, as it basically panics if the unwrapping operation fails. IMHO, it is great for quickly development and drafts, but it presents weak points in the application, which can crash at unexpected points. Below, is the output of git grep -c 'unwrap()':

src/lore_api_client.rs:1
src/lore_session.rs:6
src/main.rs:3
src/patch.rs:6

Proposal:

Handle as much as these unnecessary panics as possible. We should at least panic with a custom message... (at very very very least, use expect() to convey a custom panic message)

Setup:

  • Project branch: master
  • Project commit hash: f810883
  • rustc version: 1.79.0
  • cargo version: 1.79.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    code-improvNeeds code quality improvement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions