We've #[allow(non_snake_case)]
for declaring non-snake case field and method names. And #![allow(non_snake_case)]
to permit non-snake case throughout a module.
Afaik, these are mostly gets used to obey mathematical conventions, like uppercase elliptic curve points corresponding to lowercase scalars, but these conventions would normally be restricted by type, so turning off snake case throughout sounds excessive, no?
I've no strong opinions about the ideal syntax, but maybe..
#[allow(non_snake_case(EdwardsPoint))]`
#[allow(non_snake_case(Matrix))]`
Another approach might be keeping non_snake_case
as is, but permit more nuanced options in clippy.
You can also use #[allow]
on an impl … {…}
block, it’ll apply to each method of that block.
Sounds like there's a solution here. I'll close for now; feel free to re-open with more details if you think otherwise, @burdges.
It's fine to close. It's often members of one struct anyways. I think doing the impl helps lots if verbosity bothers you. I kinda wanted the opposite with more nuanced restrictions, but maybe doing it by type would annoy the parser.
Most helpful comment
You can also use
#[allow]
on animpl … {…}
block, it’ll apply to each method of that block.