Skip to content

Commit e1fb507

Browse files
committed
Restore deprecated apply_deferred() for longer migration period
1 parent 978867c commit e1fb507

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

godot-core/src/obj/gd.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -714,6 +714,15 @@ impl<T: GodotClass> Gd<T> {
714714
});
715715
callable.call_deferred(&[]);
716716
}
717+
718+
#[deprecated = "Split into `run_deferred()` + `run_deferred_gd()`."]
719+
pub fn apply_deferred<F>(&mut self, rust_function: F)
720+
where
721+
T: WithBaseField,
722+
F: FnOnce(&mut T) + 'static,
723+
{
724+
self.run_deferred(rust_function)
725+
}
717726
}
718727

719728
/// _The methods in this impl block are only available for objects `T` that are manually managed,

godot-core/src/obj/traits.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -550,6 +550,14 @@ pub trait WithBaseField: GodotClass + Bounds<Declarer = bounds::DeclUser> {
550550
{
551551
self.to_gd().run_deferred_gd(gd_function)
552552
}
553+
554+
#[deprecated = "Split into `run_deferred()` + `run_deferred_gd()`."]
555+
fn apply_deferred<F>(&mut self, rust_function: F)
556+
where
557+
F: FnOnce(&mut Self) + 'static,
558+
{
559+
self.run_deferred(rust_function)
560+
}
553561
}
554562

555563
/// Implemented for all classes with registered signals, both engine- and user-declared.

0 commit comments

Comments
 (0)