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

Skip to content
Commit 97436526 authored by Martin Geisler's avatar Martin Geisler Committed by Cherrypicker Worker
Browse files

pdl: Use explicit type when converting enum value

This fixes a compilation error when I compile the generated code
locally while having the Serde feature enabled:

    error[E0283]: type annotations needed
        --> tests/le/mod.rs:1488:45
         |
    1488 |         if (chunk & 0x7f) as u8 != Enum7::A.into() {
         |                                 --          ^^^^
         |                                 |
         |                                 type must be known at this point
         |
         = note: multiple `impl`s satisfying `u8: PartialEq<_>` found in the following crates: `core`, `serde_json`:
                 - impl PartialEq for u8;
                 - impl PartialEq<Value> for u8;

Tag: #feature
Bug: 228306436
Test: atest pdl_tests pdl_rust_generator_tests_{le,be} pdl_generated_files_compile
(cherry picked from https://android-review.googlesource.com/q/commit:0edd07378446075a2c17ab355393747560fd3813)
Merged-In: I01e0ed4bcb3117005453d92299e586ba1913bc3d
Change-Id: I01e0ed4bcb3117005453d92299e586ba1913bc3d
parent db57f167
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