Skip to content

Commit d84c7f9

Browse files
committed
Reduce visibility of various types and fields (#2690)
See the individual commits.
1 parent 9788b38 commit d84c7f9

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

crates/bevy_ecs/src/archetype.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@ struct TableInfo {
110110
}
111111

112112
pub(crate) struct ArchetypeSwapRemoveResult {
113-
pub swapped_entity: Option<Entity>,
114-
pub table_row: usize,
113+
pub(crate) swapped_entity: Option<Entity>,
114+
pub(crate) table_row: usize,
115115
}
116116

117117
pub(crate) struct ArchetypeComponentInfo {

crates/bevy_ecs/src/schedule/run_criteria.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,12 @@ impl Default for BoxedRunCriteria {
6161
}
6262

6363
impl BoxedRunCriteria {
64-
pub fn set(&mut self, criteria_system: BoxedSystem<(), ShouldRun>) {
64+
pub(crate) fn set(&mut self, criteria_system: BoxedSystem<(), ShouldRun>) {
6565
self.criteria_system = Some(criteria_system);
6666
self.initialized = false;
6767
}
6868

69-
pub fn should_run(&mut self, world: &mut World) -> ShouldRun {
69+
pub(crate) fn should_run(&mut self, world: &mut World) -> ShouldRun {
7070
if let Some(ref mut run_criteria) = self.criteria_system {
7171
if !self.initialized {
7272
run_criteria.initialize(world);
@@ -99,16 +99,16 @@ pub(crate) enum RunCriteriaInner {
9999
}
100100

101101
pub(crate) struct RunCriteriaContainer {
102-
pub should_run: ShouldRun,
103-
pub inner: RunCriteriaInner,
104-
pub label: Option<BoxedRunCriteriaLabel>,
105-
pub before: Vec<BoxedRunCriteriaLabel>,
106-
pub after: Vec<BoxedRunCriteriaLabel>,
102+
pub(crate) should_run: ShouldRun,
103+
pub(crate) inner: RunCriteriaInner,
104+
pub(crate) label: Option<BoxedRunCriteriaLabel>,
105+
pub(crate) before: Vec<BoxedRunCriteriaLabel>,
106+
pub(crate) after: Vec<BoxedRunCriteriaLabel>,
107107
archetype_generation: ArchetypeGeneration,
108108
}
109109

110110
impl RunCriteriaContainer {
111-
pub fn from_descriptor(descriptor: RunCriteriaDescriptor) -> Self {
111+
pub(crate) fn from_descriptor(descriptor: RunCriteriaDescriptor) -> Self {
112112
Self {
113113
should_run: ShouldRun::Yes,
114114
inner: match descriptor.system {
@@ -122,21 +122,21 @@ impl RunCriteriaContainer {
122122
}
123123
}
124124

125-
pub fn name(&self) -> Cow<'static, str> {
125+
pub(crate) fn name(&self) -> Cow<'static, str> {
126126
match &self.inner {
127127
RunCriteriaInner::Single(system) => system.name(),
128128
RunCriteriaInner::Piped { system, .. } => system.name(),
129129
}
130130
}
131131

132-
pub fn initialize(&mut self, world: &mut World) {
132+
pub(crate) fn initialize(&mut self, world: &mut World) {
133133
match &mut self.inner {
134134
RunCriteriaInner::Single(system) => system.initialize(world),
135135
RunCriteriaInner::Piped { system, .. } => system.initialize(world),
136136
}
137137
}
138138

139-
pub fn update_archetypes(&mut self, world: &World) {
139+
pub(crate) fn update_archetypes(&mut self, world: &World) {
140140
let archetypes = world.archetypes();
141141
let new_generation = archetypes.generation();
142142
let old_generation = std::mem::replace(&mut self.archetype_generation, new_generation);

crates/bevy_ecs/src/schedule/system_container.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ pub(super) struct ExclusiveSystemContainer {
3636
}
3737

3838
impl ExclusiveSystemContainer {
39-
pub fn from_descriptor(descriptor: ExclusiveSystemDescriptor) -> Self {
39+
pub(super) fn from_descriptor(descriptor: ExclusiveSystemDescriptor) -> Self {
4040
ExclusiveSystemContainer {
4141
system: descriptor.system,
4242
run_criteria_index: None,
@@ -49,7 +49,7 @@ impl ExclusiveSystemContainer {
4949
}
5050
}
5151

52-
pub fn system_mut(&mut self) -> &mut Box<dyn ExclusiveSystem> {
52+
pub(super) fn system_mut(&mut self) -> &mut Box<dyn ExclusiveSystem> {
5353
&mut self.system
5454
}
5555
}

0 commit comments

Comments
 (0)