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

Skip to content
Commit a327d905 authored by Abhishek Pandit-Subedi's avatar Abhishek Pandit-Subedi
Browse files

floss: Update cb_variant to consume values

To keep callback enum variants clean, introduce a consuming conversion
in the cb_variant! macro. This is useful when converting a pointer
+ size into a vector.

Example:

enum Foo {
  Bar(Vec<u32>),
}

cb_variant!(FooCb, bar_cb -> Foo::Bar, *const u32, usize -> _, {
  let _0 = ptr_to_vec(_0, _1);
});

Bug: 216384386
Tag: #floss
Test: Build on ChromeOS
Change-Id: I3c110bbaf5120730b589dd3efa4b952e41d7291a
parent 83a3fa87
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment