Skip to content

Commit d3a097f

Browse files
committed
Use dyn for dynamic dispatch
1 parent e438fc5 commit d3a097f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

core-graphics/src/data_provider.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,14 @@ impl CGDataProvider {
7777
///
7878
/// This is double-boxed because the Core Text API requires that the userdata be a single
7979
/// pointer.
80-
pub unsafe fn from_custom_data(custom_data: Box<Box<CustomData>>) -> Self {
80+
pub unsafe fn from_custom_data(custom_data: Box<Box<dyn CustomData>>) -> Self {
8181
let (ptr, len) = (custom_data.ptr() as *const c_void, custom_data.len());
82-
let userdata = mem::transmute::<Box<Box<CustomData>>, &mut c_void>(custom_data);
82+
let userdata = mem::transmute::<Box<Box<dyn CustomData>>, &mut c_void>(custom_data);
8383
let data_provider = CGDataProviderCreateWithData(userdata, ptr, len, Some(release));
8484
return CGDataProvider::from_ptr(data_provider);
8585

8686
unsafe extern "C" fn release(info: *mut c_void, _: *const c_void, _: size_t) {
87-
drop(mem::transmute::<*mut c_void, Box<Box<CustomData>>>(info))
87+
drop(mem::transmute::<*mut c_void, Box<Box<dyn CustomData>>>(info))
8888
}
8989
}
9090
}

0 commit comments

Comments
 (0)