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

parent 8f188284
......@@ -49,7 +49,7 @@ pub fn instance_slot_trampolines<'ast>(
let InstanceNameFfi = names.instance_ffi();
let tokens = |sig: &FnSig, parent_class: Option<Ident>| {
let trampoline_name = names.slot_trampoline(&sig.name);
let method_impl_name = names.slot_impl(sig.name.as_ref());
let method_impl_name = names.slot_impl(&sig.name);
let inputs = sig.input_args_with_glib_types();
let arg_names = sig.input_args_from_glib_types();
......@@ -109,7 +109,7 @@ pub fn slot_default_handlers<'ast>(
overrides: Option<&HashMap<Ident, Vec<Method<'ast>>>>,
) -> Vec<TokenStream> {
let method = |sig: &FnSig, body: &Block, name: Option<Ident>| {
let name = name.unwrap_or_else(|| names.slot_impl(sig.name.as_ref()));
let name = name.unwrap_or_else(|| names.slot_impl(&sig.name));
let inputs = &sig.inputs;
let output = &sig.output;
quote_cs! {
......@@ -136,7 +136,7 @@ pub fn slot_default_handlers<'ast>(
body: None,
..
}) => {
let name = names.slot_impl(sig.name.as_ref());
let name = names.slot_impl(&sig.name);
let inputs = &sig.inputs;
let output = &sig.output;
quote_cs! {
......@@ -155,7 +155,7 @@ pub fn slot_default_handlers<'ast>(
ref sig,
body: None,
}) => {
let name = names.slot_impl(sig.name.as_ref());
let name = names.slot_impl(&sig.name);
let inputs = &sig.inputs;
let output = &sig.output;
quote_cs! {
......@@ -199,7 +199,7 @@ pub fn extern_methods<'ast>(names: &Names, slots: &[Slot<'ast>]) -> Vec<TokenStr
..
}) => {
let ffi_name = names.exported_fn(sig.name.as_ref());
let method_impl_name = names.slot_impl(sig.name.as_ref());
let method_impl_name = names.slot_impl(&sig.name);
let inputs = sig.input_args_with_glib_types();
let args = sig.input_args_from_glib_types();
let ret = quote_cs! { instance.#method_impl_name(#args) };
......
......@@ -97,7 +97,7 @@ impl Names {
}
/// Given a slot name (method or signal), returns its method implementation name
pub fn slot_impl(&self, slot_name: &str) -> Ident {
pub fn slot_impl(&self, slot_name: &Ident) -> Ident {
Ident::from(format!("{}_impl", 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