https://pantsbuild.org/ logo
f

fast-nail-55400

12/14/2020, 9:17 PM
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

average-vr-56795

12/14/2020, 9:25 PM
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

fast-nail-55400

12/14/2020, 9:28 PM
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

average-vr-56795

12/14/2020, 9:29 PM
How many uses are we realistically talking here?
f

fast-nail-55400

12/14/2020, 9:29 PM
23
I might as well just comply with the lint
a

average-vr-56795

12/14/2020, 9:30 PM
Sigh, yeah, sorry!
f

fast-nail-55400

12/14/2020, 9:30 PM
(and you should see the Tonic refactor in about an hour … 🙂 )
a

average-vr-56795

12/14/2020, 9:31 PM
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

fast-nail-55400

12/14/2020, 9:32 PM
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

average-vr-56795

12/14/2020, 9:32 PM
Nothing wrong with some Boxing here and there!
w

witty-crayon-22786

12/14/2020, 10:02 PM
so, re:
Default::default
, : that’s as opposed to
ActualStruct::default
, i think… right?
ah, yea. says in original post.
f

fast-nail-55400

12/14/2020, 11:05 PM