mirror of
https://github.com/emilk/egui.git
synced 2026-08-31 22:00:03 -04:00
Enable the clippy::pedantic lint group (#8429)
Instead of opting in to pedantic lints one by one, enable the whole group and opt out of the noisy ones. 64% of the pedantic lints were already listed individually. This deletes 90 explicit lint lines, enables 51 pedantic lints we never listed, and picks up new pedantic lints for free. Each opt-out carries its hit count, so the cost of turning one back on is visible. `restriction` and `nursery` stay opt-in per lint. Stacked on top of #8430, which fixes the one real bug the new lints found. * [x] I have followed the instructions in the PR template --------- Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1761,11 +1761,11 @@ impl Context {
|
||||
.get(&id)
|
||||
.map(|v| v.repaint.cumulative_frame_nr)
|
||||
.unwrap_or_else(|| {
|
||||
if cfg!(debug_assertions) {
|
||||
panic!("cumulative_frame_nr_for failed to find the viewport {id:?}");
|
||||
} else {
|
||||
0
|
||||
}
|
||||
debug_assert!(
|
||||
false,
|
||||
"cumulative_frame_nr_for failed to find the viewport {id:?}"
|
||||
);
|
||||
0
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
@@ -41,6 +41,13 @@ impl<T: core::hash::Hash + core::fmt::Debug> AsId for T {}
|
||||
/// This is niche-optimized to that `Option<Id>` is the same size as `Id`.
|
||||
#[derive(Clone, Copy, Hash, Eq, PartialEq)]
|
||||
#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
|
||||
#[cfg_attr(
|
||||
feature = "serde",
|
||||
expect(
|
||||
clippy::unsafe_derive_deserialize,
|
||||
reason = "`from_high_entropy_bits` is only `unsafe` about entropy, not memory safety"
|
||||
)
|
||||
)]
|
||||
pub struct Id(NonZeroU64);
|
||||
|
||||
impl nohash_hasher::IsEnabled for Id {}
|
||||
|
||||
Reference in New Issue
Block a user