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

Commit 81d10e64 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "libbinder_rs: Add enum_values function to AIDL enums"

parents e9d9b27a 7f38cf97
Loading
Loading
Loading
Loading
+6 −1
Original line number Original line Diff line number Diff line
@@ -897,7 +897,7 @@ macro_rules! declare_binder_interface {
#[macro_export]
#[macro_export]
macro_rules! declare_binder_enum {
macro_rules! declare_binder_enum {
    {
    {
        $enum:ident : $backing:ty {
        $enum:ident : [$backing:ty; $size:expr] {
            $( $name:ident = $value:expr, )*
            $( $name:ident = $value:expr, )*
        }
        }
    } => {
    } => {
@@ -905,6 +905,11 @@ macro_rules! declare_binder_enum {
        pub struct $enum(pub $backing);
        pub struct $enum(pub $backing);
        impl $enum {
        impl $enum {
            $( pub const $name: Self = Self($value); )*
            $( pub const $name: Self = Self($value); )*

            #[inline(always)]
            pub const fn enum_values() -> [Self; $size] {
                [$(Self::$name),*]
            }
        }
        }


        impl $crate::parcel::Serialize for $enum {
        impl $crate::parcel::Serialize for $enum {