Mark Query and QuerySet contructors as pub(crate) (#829)

Mark Query and QuerySet contructors as pub(crate)
This commit is contained in:
memoryruins 2020-11-10 19:14:33 -05:00 committed by GitHub
parent 60fa2d5f93
commit a68c217ccf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View File

@ -31,7 +31,7 @@ impl<'a, Q: HecsQuery> Query<'a, Q> {
/// This will create a Query that could violate memory safety rules. Make sure that this is only called in
/// ways that ensure the Queries have unique mutable access.
#[inline]
pub unsafe fn new(
pub(crate) unsafe fn new(
world: &'a World,
component_access: &'a TypeAccess<ArchetypeComponent>,
) -> Self {

View File

@ -20,7 +20,10 @@ impl<T: QueryTuple> QuerySet<T> {
/// # Safety
/// This will create a set of Query types that could violate memory safety rules. Make sure that this is only called in
/// ways that ensure the Queries have unique mutable access.
pub unsafe fn new(world: &World, component_access: &TypeAccess<ArchetypeComponent>) -> Self {
pub(crate) unsafe fn new(
world: &World,
component_access: &TypeAccess<ArchetypeComponent>,
) -> Self {
QuerySet {
value: T::new(world, component_access),
}