HiveBrain v1.2.0
Get Started
← Back to all entries
patternrustCritical

Is there some way to not show a warning for non snake case identifiers?

Submitted by: @import:stackoverflow-api··
0
Viewed 0 times
warningsomeidentifierssnakefornonwaynotshowcase

Problem

I'm writing my first tests in Rust and I find this:


warning: function testCall should have a snake case name such as
test_call, #[warn(non_snake_case)] on by default

after searching, I found this style guide.

I understand it is a convention, but is there some way to not show this warning?

Solution

You can use the allow attribute as such:

#[allow(non_snake_case)]
fn nonSnakeCase() {}


More on attributes here.

Code Snippets

#[allow(non_snake_case)]
fn nonSnakeCase() {}

Context

Stack Overflow Q#36344415, score: 111

Revisions (0)

No revisions yet.