Skip to content

Commit fdf587c

Browse files
committed
fixup! Mute clippy transmute warnings
1 parent 768a4c6 commit fdf587c

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

qmetaobject_impl/src/qobject_impl.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -686,7 +686,10 @@ pub fn generate(input: TokenStream, is_qobject: bool, qt_version: QtVersion) ->
686686
} else {
687687
quote! {
688688
#[allow(unused_variables)]
689-
let mut obj = &*o;
689+
let mut obj: &mut #name #ty_generics = &mut *(::std::mem::transmute::<
690+
*mut ::std::os::raw::c_void,
691+
*mut #name #ty_generics,
692+
>(o));
690693
}
691694
};
692695

@@ -866,7 +869,7 @@ pub fn generate(input: TokenStream, is_qobject: bool, qt_version: QtVersion) ->
866869
// FIXME! we should probably use the signature verbatim
867870
let n = &arg.name;
868871
let ty = &arg.typ;
869-
quote! { #n : #ty }
872+
quote! { mut #n : #ty }
870873
})
871874
.collect();
872875
let args_ptr: Vec<_> = signal
@@ -876,10 +879,7 @@ pub fn generate(input: TokenStream, is_qobject: bool, qt_version: QtVersion) ->
876879
let n = &arg.name;
877880
let ty = &arg.typ;
878881
quote! {
879-
{
880-
let mut n = #n;
881-
(&mut n as *mut #ty as *mut ::std::os::raw::c_void)
882-
}
882+
(&mut #n as *mut #ty as *mut ::std::os::raw::c_void)
883883
}
884884
})
885885
.collect();

0 commit comments

Comments
 (0)