我买了一些像这样的薄纱:
warning: methods called `to_*` usually take self by reference; consider choosing a less ambiguous name
--> src/helpers/mod.rs:29:32
|
29 | pub fn to_vec_sorted<U, F>(self, mapper: F) -> Vec<U>
| ^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention
我处理这个lint没有问题,我 Select 它是因为它没有显示任何专有代码.假设我有一个很好的理由,为什么我需要这样命名函数,而且Clippy被集成到我的CI中,所以我需要零Clippy错误/警告.
有没有办法禁用Clippy lint for a particular line or code block,类似于Java中的@SuppressWarnings("whatever")
?我觉得肯定有,但我在文档中找不到任何这样做的例子.