lurk-rs icon indicating copy to clipboard operation
lurk-rs copied to clipboard

Potential unintentional panics in the codebase

Open huitseeker opened this issue 2 years ago • 2 comments

The command cargo clippy -- -D 'clippy::panic_in_result_fn will reveal several instances of panics occurring within a block returning a result.

Some of there are warranted and unrecoverable (e.g. unreachable! in eval, or assert! instances in many cases). Some are probably not warranted and could probably be recovered (e.g. some instances of .unwrap in src/writer.rs's Write<F> for Expression<F> [^1]).

In the later case, we should fold the error management within the error case of the Result.

[^1]: see also cargo clippy --fix -- -D 'clippy::unwrap_in_result'

huitseeker avatar Aug 12 '23 21:08 huitseeker

Hi team, Can I work on this issue?

In the later case, we should fold the error management within the error case of the Result.

This means we will change 'unwrap' and 'expect' to Err in the functions found by cargo clippy --fix -- -D 'clippy::unwrap_in_result'.

Thank you!

vuvoth avatar Feb 06 '24 03:02 vuvoth

Sure, go for it 👍🏼

arthurpaulino avatar Feb 06 '24 22:02 arthurpaulino