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

Commit e37dfe0e authored by Henri Chataing's avatar Henri Chataing
Browse files

pdl: Revert changes from I8b7f7dcde94a03e64b81b9503031d67ae846aef8

Manual revert as the revert commit does not apply cleanly.
Fix additional clippy warnings.

Test: cargo build
Change-Id: I85b1163855bb6e88c390bcca81e0baa49477727a
Merged-In: Idfbf269d253f93786a63ebdb810c6200da0d2c45
parent 5da6b5a5
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -12,7 +12,7 @@ pub mod ast {
    use serde::Serialize;

    /// Field and declaration size information.
    #[derive(Default, Debug, Clone, Copy)]
    #[derive(Debug, Clone, Copy)]
    #[allow(unused)]
    pub enum Size {
        /// Constant size in bits.
@@ -22,10 +22,16 @@ pub mod ast {
        Dynamic,
        /// The size cannot be determined statically or at runtime.
        /// The packet assumes the largest possible size.
        #[default]
        Unknown,
    }

    // TODO: use derive(Default) when UWB is using Rust 1.62.0.
    impl Default for Size {
        fn default() -> Size {
            Size::Unknown
        }
    }

    #[derive(Debug, Serialize, Default, Clone, PartialEq)]
    pub struct Annotation;

+1 −1
Original line number Diff line number Diff line
@@ -426,7 +426,7 @@ fn generate_packet_decl(
        let named_fields = {
            let mut names =
                parent_packet_scope.iter_fields().filter_map(ast::Field::id).collect::<Vec<_>>();
            names.sort();
            names.sort_unstable();
            names
        };

+1 −1
Original line number Diff line number Diff line
use crate::analyzer::ast as analyzer_ast;
use crate::backends::rust::{mask_bits, types};
use crate::backends::rust::{mask_bits, types, ToUpperCamelCase};
use crate::{ast, lint};
use quote::{format_ident, quote};