Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - Remove APIs deprecated in 0.9 #6801

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 1 addition & 30 deletions crates/bevy_ecs/src/system/commands/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -243,16 +243,6 @@ impl<'w, 's> Commands<'w, 's> {
e
}

#[deprecated(
since = "0.9.0",
note = "Use `spawn` instead, which now accepts bundles, components, and tuples of bundles and components."
)]
pub fn spawn_bundle<'a, T: Bundle>(&'a mut self, bundle: T) -> EntityCommands<'w, 's, 'a> {
let mut e = self.spawn_empty();
e.insert(bundle);
e
}

/// Returns the [`EntityCommands`] for the requested [`Entity`].
///
/// # Panics
Expand Down Expand Up @@ -397,7 +387,7 @@ impl<'w, 's> Commands<'w, 's> {
///
/// This method is equivalent to iterating `bundles_iter`,
/// calling [`get_or_spawn`](Self::get_or_spawn) for each bundle,
/// and passing it to [`insert_bundle`](EntityCommands::insert_bundle),
/// and passing it to [`insert`](EntityCommands::insert),
/// but it is faster due to memory pre-allocation.
///
/// # Note
Expand Down Expand Up @@ -620,14 +610,6 @@ impl<'w, 's, 'a> EntityCommands<'w, 's, 'a> {
self
}

#[deprecated(
since = "0.9.0",
note = "Use `insert` instead, which now accepts bundles, components, and tuples of bundles and components."
)]
pub fn insert_bundle(&mut self, bundle: impl Bundle) -> &mut Self {
self.insert(bundle)
}

/// Removes a [`Bundle`] of components from the entity.
///
/// See [`EntityMut::remove`](crate::world::EntityMut::remove) for more
Expand Down Expand Up @@ -677,17 +659,6 @@ impl<'w, 's, 'a> EntityCommands<'w, 's, 'a> {
self
}

#[deprecated(
since = "0.9.0",
note = "Use `remove` instead, which now accepts bundles, components, and tuples of bundles and components."
)]
pub fn remove_bundle<T>(&mut self) -> &mut Self
where
T: Bundle,
{
self.remove::<T>()
}

/// Despawns the entity.
///
/// See [`World::despawn`] for more details.
Expand Down
24 changes: 0 additions & 24 deletions crates/bevy_ecs/src/world/entity_ref.rs
Original file line number Diff line number Diff line change
Expand Up @@ -229,14 +229,6 @@ impl<'w> EntityMut<'w> {
})
}

#[deprecated(
since = "0.9.0",
note = "Use `insert` instead, which now accepts bundles, components, and tuples of bundles and components."
)]
pub fn insert_bundle<T: Bundle>(&mut self, bundle: T) -> &mut Self {
self.insert(bundle)
}

/// Adds a [`Bundle`] of components to the entity.
///
/// This will overwrite any previous value(s) of the same component type.
Expand All @@ -262,14 +254,6 @@ impl<'w> EntityMut<'w> {
self
}

#[deprecated(
since = "0.9.0",
note = "Use `remove` instead, which now accepts bundles, components, and tuples of bundles and components."
)]
pub fn remove_bundle<T: Bundle>(&mut self) -> Option<T> {
self.remove::<T>()
}

// TODO: move to BundleInfo
/// Removes a [`Bundle`] of components from the entity and returns the bundle.
///
Expand Down Expand Up @@ -398,14 +382,6 @@ impl<'w> EntityMut<'w> {
entities.set(entity.index(), new_location);
}

#[deprecated(
since = "0.9.0",
note = "Use `remove_intersection` instead, which now accepts bundles, components, and tuples of bundles and components."
)]
pub fn remove_bundle_intersection<T: Bundle>(&mut self) {
self.remove_intersection::<T>();
}

// TODO: move to BundleInfo
/// Remove any components in the bundle that the entity has.
pub fn remove_intersection<T: Bundle>(&mut self) {
Expand Down