is there any opinion on `clippy::default_trait_acc...
# development
f
is there any opinion on
clippy::default_trait_access
which flags code that uses
Default::default()
? I am using
Default::default
via the
..Default::default()
syntax to fill in default values in some Prost-generated protobuf structs. I could repeat the struct name itself to comply with the lint but the
..Default::default()
syntax seems fine to me.
a
Yeah,
Default::default()
seems fairly unambiguous in that instance… Can you file a bug against https://github.com/rust-lang/rust-clippy for it?
(I wrote that particular clippy lint 🙂)
f
will do. in the meantime, do I just comply with the lint? seems annoying if I have to put
#![allow(clippy::default_trait_access)]
at the top of every file.
or could just do that, less annoying than changing all the use sites
a
How many uses are we realistically talking here?
f
23
I might as well just comply with the lint
a
Sigh, yeah, sorry!
f
(and you should see the Tonic refactor in about an hour … 🙂 )
a
Hurrah! Looking forward to it, expecting it to be so much cleaner and probably shave 30% off of the build time? Maybe 60% off a clean build on a new machine?
f
haven’t benchmarked it yet, and as you’ll see in the PR to come, I may need to Box some async futures because I had to set RUST_MIN_STACK to get tests to run without a stack overflow, so still some work to do
a
Nothing wrong with some Boxing here and there!
w
so, re:
Default::default
, : that’s as opposed to
ActualStruct::default
, i think… right?
ah, yea. says in original post.
f