use-ink/ink

Add global clippy rules

Open

#886 建立於 2021年8月4日

在 GitHub 查看
 (3 留言) (0 反應) (0 負責人)Rust (476 fork)github user discovery
B-enhancementgood first issue

倉庫指標

Star
 (1,459 star)
PR 合併指標
 (PR 指標待抓取)

描述

This issue is blocked by https://github.com/rust-lang/cargo/issues/5034.

We want to have some global clippy rules.

bool_assert_comparison

Allows syntax a la:

assert_eq!(flipper.get(), false);
assert_eq!(flipper.get(), true);

This is the bool_assert_comparison rule, which should be allowed.

With https://github.com/paritytech/ink/pull/884 we unfortunately had to change assert_eq!(flipper.get(), false); to assert!(!flipper.get());. These assert!(!…) expressions should be reverted to the boolean comparison.

new_without_default

For example, our flipper example in readme is currently no valid if you run clippy on it, since it misses a Default implementation for Flipper. This should not be necessary.

貢獻者指南