Take Into<Handle> in image::allocate

This commit is contained in:
Héctor Ramón Jiménez 2025-10-27 00:02:29 +01:00
parent 0001b18408
commit c0fb3ea9e8
No known key found for this signature in database
GPG key ID: 7CC46565708259A7

View file

@ -17,8 +17,8 @@ pub enum Action {
/// When you obtain an [`Allocation`] explicitly, you get the guarantee
/// that using a [`Handle`] will draw the corresponding image immediately
/// in the next frame.
pub fn allocate(handle: Handle) -> Task<Allocation> {
pub fn allocate(handle: impl Into<Handle>) -> Task<Allocation> {
task::oneshot(|sender| {
crate::Action::Image(Action::Allocate(handle, sender))
crate::Action::Image(Action::Allocate(handle.into(), sender))
})
}