Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 85bfef55 authored by Sonny Sasaka's avatar Sonny Sasaka
Browse files

Floss: Fix cb_variant expect message

`#dispatcher` should be stringified before passed to `expect` to show
the name of the `dispatcher` type.

Bug: 224602924
Tag: #floss
Test: Manual - Trigger missing dispatcher

Change-Id: Iba18965578a6bd1ceff07245785d4298533e76f4
parent 5d174f87
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -122,6 +122,7 @@ pub fn cb_variant(input: TokenStream) -> TokenStream {
        stmts.extend(quote! { #stmt });
    }

    let dispatcher_str = quote!(#dispatcher).to_string();
    let tokens = quote! {
        #[no_mangle]
        extern "C" fn #ident(#params) {
@@ -130,10 +131,10 @@ pub fn cb_variant(input: TokenStream) -> TokenStream {
                    .lock()
                    .expect("Couldn't lock dispatchers!")
                    .get::<#dispatcher>()
                    .expect("Couldn't find dispatcher type: #dispatcher")
                    .expect(concat!("Couldn't find dispatcher type: ", #dispatcher_str))
                    .clone()
                    .lock()
                    .expect("Couldn't lock specific dispatcher: #dispatcher")
                    .expect(concat!("Couldn't lock specific dispatcher: ", #dispatcher_str))
                    .dispatch)(#rpath(#args));
            }
    };