From 53cd9fa41ba8d57837e2f0704e126bf2f494e824 Mon Sep 17 00:00:00 2001 From: Thor Date: Sat, 27 Jan 2024 10:58:08 +0100 Subject: [PATCH] changed 'component' to 'section' in identifiers and comments referring to text sections --- crates/bevy_diagnostic/src/diagnostic.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/crates/bevy_diagnostic/src/diagnostic.rs b/crates/bevy_diagnostic/src/diagnostic.rs index f3b0bb04c0934..3169ffcfd05cd 100644 --- a/crates/bevy_diagnostic/src/diagnostic.rs +++ b/crates/bevy_diagnostic/src/diagnostic.rs @@ -13,7 +13,7 @@ use crate::DEFAULT_MAX_HISTORY_LENGTH; /// Requirements: /// - Can't be empty /// - Can't have leading or trailing `/` -/// - Can't have empty components. +/// - Can't have empty sections. #[derive(Debug, Clone)] pub struct DiagnosticPath { path: Cow<'static, str>, @@ -46,7 +46,7 @@ impl DiagnosticPath { ); debug_assert!( !path.contains("//"), - "diagnostic path can't contain empty components" + "diagnostic path can't contain empty sections" ); DiagnosticPath { @@ -55,15 +55,15 @@ impl DiagnosticPath { } } - /// Create a new `DiagnosticPath` from an iterator over components. - pub fn from_components<'a>(components: impl IntoIterator) -> DiagnosticPath { + /// Create a new `DiagnosticPath` from an iterator over sections. + pub fn from_sections<'a>(sections: impl IntoIterator) -> DiagnosticPath { let mut buf = String::new(); - for (i, component) in components.into_iter().enumerate() { + for (i, section) in sections.into_iter().enumerate() { if i > 0 { buf.push('/'); } - buf.push_str(component); + buf.push_str(section); } DiagnosticPath::new(buf) @@ -74,8 +74,8 @@ impl DiagnosticPath { &self.path } - /// Returns an iterator over path components. - pub fn components(&self) -> impl Iterator + '_ { + /// Returns an iterator over path sections. + pub fn sections(&self) -> impl Iterator + '_ { self.path.split('/') } }