Skip to content

Commit 75a5046

Browse files
Add get() method to declare_binder_enum
This returns the value of the enum as the backing type. Test: atest aidl_integration_test Bug: 393455995 Change-Id: Ic35021edfdabf59ce2017b91ee4f65953c071c70
1 parent 69f67e7 commit 75a5046

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

libs/binder/rust/src/binder.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1160,6 +1160,12 @@ macro_rules! declare_binder_enum {
11601160
pub const fn enum_values() -> [Self; $size] {
11611161
[$(Self::$name),*]
11621162
}
1163+
1164+
#[inline(always)]
1165+
#[allow(missing_docs)]
1166+
pub const fn get(&self) -> $backing {
1167+
self.0
1168+
}
11631169
}
11641170

11651171
impl std::fmt::Debug for $enum {

0 commit comments

Comments
 (0)