Rust-clippy: catch `assert!` `assert_eq!` `assert_ne!` and variants in ResultFN

Created on 25 Sep 2020  路  6Comments  路  Source: rust-lang/rust-clippy

What it does

catch assert! assert_eq! assert_ne! and variants in ResultFN

in a function that returns result , it is very likely the use of these macros are plain wrong.

Categories (optional)

similar to https://rust-lang.github.io/rust-clippy/master/#panic_in_result_fn

L-lint good-first-issue hacktoberfest

All 6 comments

@nahuakang This seems like a good first issue to me.

A similar lint is already implemented and code can probably shared with that lint. So what you would have to do is to look at the panic_in_result_fn lint, understand how it works and implement the same (optimally sharing code) for assert macros. And obviously write tests for them.

Thanks Phil. I'll pick up on your hints!

@nahuakang are you still working on this issue?

@dp304 Yes I intend to. _Edit:_ I'm gonna get started on it soon :)

@nahuakang I haven't noticed your comment edit, so I've made a PR. Sorry about that.

Cool, then I'll read your PR and learn from you!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

durka picture durka  路  17Comments

davemilter picture davemilter  路  18Comments

b1zzu picture b1zzu  路  28Comments

Manishearth picture Manishearth  路  18Comments

BenjaminGill-Metaswitch picture BenjaminGill-Metaswitch  路  22Comments