deny(missing_docs) for bevy_diagnostic (#19482)

# Objective

Deny missing docs in bevy_diagnostic, towards
https://github.com/bevyengine/bevy/issues/3492.
This commit is contained in:
theotherphil 2025-06-04 02:30:10 +01:00 committed by GitHub
parent e7a309ff5f
commit c5dcef5e61
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 8 additions and 1 deletions

View File

@ -19,8 +19,10 @@ impl Plugin for EntityCountDiagnosticsPlugin {
}
impl EntityCountDiagnosticsPlugin {
/// Number of currently allocated entities.
pub const ENTITY_COUNT: DiagnosticPath = DiagnosticPath::const_new("entity_count");
/// Updates entity count measurement.
pub fn diagnostic_system(mut diagnostics: Diagnostics, entities: &Entities) {
diagnostics.add_measurement(&Self::ENTITY_COUNT, || entities.len() as f64);
}

View File

@ -58,10 +58,16 @@ impl Plugin for FrameTimeDiagnosticsPlugin {
}
impl FrameTimeDiagnosticsPlugin {
/// Frames per second.
pub const FPS: DiagnosticPath = DiagnosticPath::const_new("fps");
/// Total frames since application start.
pub const FRAME_COUNT: DiagnosticPath = DiagnosticPath::const_new("frame_count");
/// Frame time in ms.
pub const FRAME_TIME: DiagnosticPath = DiagnosticPath::const_new("frame_time");
/// Updates frame count, frame time and fps measurements.
pub fn diagnostic_system(
mut diagnostics: Diagnostics,
time: Res<Time<Real>>,

View File

@ -1,4 +1,3 @@
#![expect(missing_docs, reason = "Not all docs are written yet, see #3492.")]
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
#![forbid(unsafe_code)]
#![doc(