From c5dcef5e61931b00d5189c2bb1febc3709482071 Mon Sep 17 00:00:00 2001 From: theotherphil Date: Wed, 4 Jun 2025 02:30:10 +0100 Subject: [PATCH] deny(missing_docs) for bevy_diagnostic (#19482) # Objective Deny missing docs in bevy_diagnostic, towards https://github.com/bevyengine/bevy/issues/3492. --- .../bevy_diagnostic/src/entity_count_diagnostics_plugin.rs | 2 ++ crates/bevy_diagnostic/src/frame_time_diagnostics_plugin.rs | 6 ++++++ crates/bevy_diagnostic/src/lib.rs | 1 - 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/crates/bevy_diagnostic/src/entity_count_diagnostics_plugin.rs b/crates/bevy_diagnostic/src/entity_count_diagnostics_plugin.rs index 91874a390c..b20a82bf6c 100644 --- a/crates/bevy_diagnostic/src/entity_count_diagnostics_plugin.rs +++ b/crates/bevy_diagnostic/src/entity_count_diagnostics_plugin.rs @@ -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); } diff --git a/crates/bevy_diagnostic/src/frame_time_diagnostics_plugin.rs b/crates/bevy_diagnostic/src/frame_time_diagnostics_plugin.rs index 22b6176fa2..a632c1b49a 100644 --- a/crates/bevy_diagnostic/src/frame_time_diagnostics_plugin.rs +++ b/crates/bevy_diagnostic/src/frame_time_diagnostics_plugin.rs @@ -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>, diff --git a/crates/bevy_diagnostic/src/lib.rs b/crates/bevy_diagnostic/src/lib.rs index 588b3276f6..1b1beb9c36 100644 --- a/crates/bevy_diagnostic/src/lib.rs +++ b/crates/bevy_diagnostic/src/lib.rs @@ -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(