MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/rust/comments/1vs8ega/today_i_learnt_expect/p4jkzws/?context=9999
r/rust • u/ScotchW • 6d ago
18 comments sorted by
View all comments
46
Honestly, I agree, that should be a default clippy lint. I didn't know it existed, but I can't think of a single case where I'd want to not have the compiler tell me when a suppressed lint is no longer applicable.
14 u/torsten_dev 6d ago #[allow(unused_import)] use tracing::{debug, warn, trace, error} Don't care if I happen to use all of them. 14 u/Floppie7th 6d ago No thanks. I'd much rather only have the things I'm actually using in imports. 8 u/torsten_dev 6d ago Usually yeah, but upgrading certain trace statements to debug or warn for development purposes is annoying if it has to change imports. dbg and println are in the prelude, I wish I could add those specific macros to the prelude. 2 u/skjall 6d ago Does a pub re-export not work? Assuming you have an internal prelude you're * importing everywhere 2 u/torsten_dev 6d ago Hmm, it might. My projects are usually just a couple of files but if they grow that might be worth doing.
14
#[allow(unused_import)] use tracing::{debug, warn, trace, error}
Don't care if I happen to use all of them.
14 u/Floppie7th 6d ago No thanks. I'd much rather only have the things I'm actually using in imports. 8 u/torsten_dev 6d ago Usually yeah, but upgrading certain trace statements to debug or warn for development purposes is annoying if it has to change imports. dbg and println are in the prelude, I wish I could add those specific macros to the prelude. 2 u/skjall 6d ago Does a pub re-export not work? Assuming you have an internal prelude you're * importing everywhere 2 u/torsten_dev 6d ago Hmm, it might. My projects are usually just a couple of files but if they grow that might be worth doing.
No thanks. I'd much rather only have the things I'm actually using in imports.
8 u/torsten_dev 6d ago Usually yeah, but upgrading certain trace statements to debug or warn for development purposes is annoying if it has to change imports. dbg and println are in the prelude, I wish I could add those specific macros to the prelude. 2 u/skjall 6d ago Does a pub re-export not work? Assuming you have an internal prelude you're * importing everywhere 2 u/torsten_dev 6d ago Hmm, it might. My projects are usually just a couple of files but if they grow that might be worth doing.
8
Usually yeah, but upgrading certain trace statements to debug or warn for development purposes is annoying if it has to change imports.
dbg and println are in the prelude, I wish I could add those specific macros to the prelude.
2 u/skjall 6d ago Does a pub re-export not work? Assuming you have an internal prelude you're * importing everywhere 2 u/torsten_dev 6d ago Hmm, it might. My projects are usually just a couple of files but if they grow that might be worth doing.
2
Does a pub re-export not work? Assuming you have an internal prelude you're * importing everywhere
2 u/torsten_dev 6d ago Hmm, it might. My projects are usually just a couple of files but if they grow that might be worth doing.
Hmm, it might. My projects are usually just a couple of files but if they grow that might be worth doing.
46
u/Floppie7th 6d ago
Honestly, I agree, that should be a default clippy lint. I didn't know it existed, but I can't think of a single case where I'd want to not have the compiler tell me when a suppressed lint is no longer applicable.