这不是在谷歌上,所以我恳请某人如何压制这个警告:
342 | BAYER_RGGB16,
| ^^^^^^^^^^^^ help: convert the identifier to upper camel case: `BayerRggb16`
#[allow(non_snake_case)]
不起作用.
这不是在谷歌上,所以我恳请某人如何压制这个警告:
342 | BAYER_RGGB16,
| ^^^^^^^^^^^^ help: convert the identifier to upper camel case: `BayerRggb16`
#[allow(non_snake_case)]
不起作用.
您正在寻找non-camel-case-types
号皮棉选项.rustc -W help
中对该支票的描述如下:
name default meaning non-camel-case-types warn types, variants, traits and type parameters should have camel case names
在您的代码片段中,BAYER_RGGB16
似乎是一个枚举变量,因此默认的lint选项要求它在(上)CamelCase中命名.lint attribute #[allow(non_camel_case_types)]
可禁用该判断:
// Can also be applied to the whole enum, instead of just one variant.
// #[allow(non_camel_case_types)]
enum MyEnum {
// ...
#[allow(non_camel_case_types)]
BAYER_RGGB16,
}
Try it yourself人在Rust 的操场上.