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

Commit fa27e39d authored by Hansong Zhang's avatar Hansong Zhang
Browse files

Fix some linter issues in topshim

Test: compile
Change-Id: I3bce692aacc719755110e279cdbffa9cbbddfb4c
parent 8fe6f436
Loading
Loading
Loading
Loading
+3 −5
Original line number Diff line number Diff line
//! Macro for topshim

extern crate proc_macro;

use proc_macro::TokenStream;
@@ -54,11 +56,7 @@ impl Parse for CbVariant {
            }
        }

        // If the parse stream isn't empty or a comma, we have an error
        if !input.is_empty() || !input.peek(Token![,]) {
            ()
        }

        // TODO: Validate there are no more tokens; currently they are ignored.
        Ok(CbVariant { dispatcher, fn_pair: (name, rpath), arg_pairs, stmts })
    }
}
+5 −1
Original line number Diff line number Diff line
@@ -609,7 +609,11 @@ impl BluetoothInterface {
        profile: SupportedProfiles,
    ) -> *const std::os::raw::c_void {
        let cprofile = Vec::<u8>::from(profile);
        ccall!(self, get_profile_interface, cprofile.as_slice().as_ptr() as *const i8)
        ccall!(
            self,
            get_profile_interface,
            cprofile.as_slice().as_ptr() as *const std::os::raw::c_char
        )
    }

    pub(crate) fn as_raw_ptr(&self) -> *const u8 {
+3 −7
Original line number Diff line number Diff line
@@ -68,7 +68,7 @@ impl From<u32> for A2dpCodecIndex {
pub enum A2dpCodecPriority {
    Disabled = -1,
    Default = 0,
    Highest = 1000_000,
    Highest = 1_000_000,
}

impl From<i32> for A2dpCodecPriority {
@@ -305,12 +305,8 @@ impl A2dp {
    }

    pub fn set_audio_config(&mut self, sample_rate: i32, bits_per_sample: i32, channel_mode: i32) {
        let config = A2dpCodecConfig {
            sample_rate: sample_rate,
            bits_per_sample: bits_per_sample,
            channel_mode: channel_mode,
            ..Default::default()
        };
        let config =
            A2dpCodecConfig { sample_rate, bits_per_sample, channel_mode, ..Default::default() };
        self.internal.pin_mut().set_audio_config(config);
    }
    pub fn start_audio_request(&mut self) {
+1 −1
Original line number Diff line number Diff line
@@ -281,7 +281,7 @@ impl HidHost {
            set_report,
            ffi_addr,
            bindings::bthh_report_type_t::from(report_type),
            report.as_mut_ptr() as *mut i8
            report.as_mut_ptr() as *mut std::os::raw::c_char
        ))
    }