Skip to content

Commit

Permalink
codegen: Fully quality std::mem::transmute
Browse files Browse the repository at this point in the history
  • Loading branch information
bilelmoussaoui committed Aug 16, 2023
1 parent 92508fc commit a89a202
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 3 deletions.
1 change: 0 additions & 1 deletion src/analysis/properties.rs
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,6 @@ fn analyze_property(
imports.add("glib::prelude::*");
}
imports.add("glib::signal::{connect_raw, SignalHandlerId}");
imports.add("std::mem::transmute");
imports.add("std::boxed::Box as Box_");

Some(signals::Info {
Expand Down
1 change: 0 additions & 1 deletion src/analysis/signals.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ fn analyze_signal(
imports.add_used_types(&used_types);
imports.add("glib::prelude::*");
imports.add("glib::signal::{connect_raw, SignalHandlerId}");
imports.add("std::mem::transmute");
imports.add("std::boxed::Box as Box_");
}
let generate_doc = configured_signals.iter().all(|f| f.generate_doc);
Expand Down
2 changes: 1 addition & 1 deletion src/writer/to_code.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ impl ToCode for Chunk {
}
let self_str = if in_trait { "Self, " } else { "" };
v.push(format!(
"\tSome(transmute::<_, unsafe extern \"C\" fn()>({trampoline}::<{self_str}F> as *const ())), Box_::into_raw(f))"
"\tSome(std::mem::transmute::<_, unsafe extern \"C\" fn()>({trampoline}::<{self_str}F> as *const ())), Box_::into_raw(f))"
));
v
}
Expand Down

0 comments on commit a89a202

Please sign in to comment.