Repository navigation
|
I have the following code (using once_cell crate): static METER: Lazy<Meter> = Lazy::new(|| init_otel_metrics());which gives ' help: replace the closure with the function itself: however, i think the proper fix is this (though i'm not sure why it's necessary?) static METER: Lazy<Meter> = Lazy::new(|| { init_otel_metrics() });Unfortunately rust-analyzer reverts this back tot he first form when running a 'format' on the code (rustfmt::skip takes care of it) am I misunderstanding something? (clippy 0.1.88) Similar issue, but I'm not sure if it's the same exactly, the one in the issue seems more severe: #15072 |
Answered by
Alexendoo
Aug 8, 2025
Replies: 2 comments 1 reply
|
Could you provide a larger example? With a plain function at least that seems to work fine - https://play.rust-lang.org/?version=stable&mode=debug&edition=2024&gist=242f87f15da018bda634c330b3fb1ea9 |
0 replies
Answer selected by
CommanderStorm
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Could you provide a larger example? With a plain function at least that seems to work fine - https://play.rust-lang.org/?version=stable&mode=debug&edition=2024&gist=242f87f15da018bda634c330b3fb1ea9