Names.slot_trampoline() - take an &Ident, not a &str

parent fd9bcb02
......@@ -58,7 +58,7 @@ impl<'ast> ClassContext<'ast> {
for (parent_class, methods) in self.class.overrides.iter() {
for method in methods.iter() {
let name = method.sig.name;
let trampoline_name = self.names.slot_trampoline(method.sig.name.as_ref());
let trampoline_name = self.names.slot_trampoline(&method.sig.name);
ret.push(quote_cs! {
(
......
......@@ -18,7 +18,7 @@ pub fn slot_assignments<'ast>(names: &Names, slots: &[Slot<'ast>]) -> Vec<TokenS
Slot::VirtualMethod(VirtualMethod { ref sig, .. }) => {
let name = sig.name;
let trampoline_name = names.slot_trampoline(sig.name.as_ref());
let trampoline_name = names.slot_trampoline(&name);
Some(quote_cs! {
vtable.#name = Some(#InstanceNameFfi::#trampoline_name);
......@@ -27,7 +27,7 @@ pub fn slot_assignments<'ast>(names: &Names, slots: &[Slot<'ast>]) -> Vec<TokenS
Slot::Signal(ref signal) => {
let signalname = signal.sig.name;
let trampoline_name = names.slot_trampoline(signalname.as_ref());
let trampoline_name = names.slot_trampoline(&signalname);
Some(quote_cs! {
vtable.#signalname = Some(#InstanceNameFfi::#trampoline_name);
......@@ -48,7 +48,7 @@ pub fn instance_slot_trampolines<'ast>(
let InstanceName = names.instance();
let InstanceNameFfi = names.instance_ffi();
let tokens = |sig: &FnSig, parent_class: Option<Ident>| {
let trampoline_name = names.slot_trampoline(sig.name.as_ref());
let trampoline_name = names.slot_trampoline(&sig.name);
let method_impl_name = names.slot_impl(sig.name.as_ref());
let inputs = sig.input_args_with_glib_types();
let arg_names = sig.input_args_from_glib_types();
......
......@@ -92,7 +92,7 @@ impl Names {
}
/// Given a slot name (method or signal), returns its trampoline name
pub fn slot_trampoline(&self, slot_name: &str) -> Ident {
pub fn slot_trampoline(&self, slot_name: &Ident) -> Ident {
Ident::from(format!("{}_slot_trampoline", slot_name))
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment