Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SmartAudio
# `SmartAudio`
[![CI](https://github.com/jettify/smartaudio/actions/workflows/CI.yml/badge.svg)](https://github.com/jettify/smartaudio/actions/workflows/CI.yml)
[![codecov](https://codecov.io/gh/jettify/smartaudio/graph/badge.svg?token=RCM2W4C0LB)](https://codecov.io/gh/jettify/smartaudio)
[![crates.io](https://img.shields.io/crates/v/smartaudio)](https://crates.io/crates/smartaudio)
Expand Down
8 changes: 4 additions & 4 deletions src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@ pub struct SetModeCommand {

impl SmartAudioCommand for SetModeCommand {
fn to_bytes(&self, buffer: &mut [u8]) -> Result<usize, SmartAudioError> {
let mode = (self.pitmode_in_range_active as u8 * mode_flags::PITMODE_IN_RANGE)
| (self.pitmode_out_range_active as u8 * mode_flags::PITMODE_OUT_RANGE)
| (self.pitmode_enabled as u8 * mode_flags::PITMODE_ENABLED)
| (self.unlocked as u8 * mode_flags::UNLOCKED);
let mode = (u8::from(self.pitmode_in_range_active) * mode_flags::PITMODE_IN_RANGE)
| (u8::from(self.pitmode_out_range_active) * mode_flags::PITMODE_OUT_RANGE)
| (u8::from(self.pitmode_enabled) * mode_flags::PITMODE_ENABLED)
| (u8::from(self.unlocked) * mode_flags::UNLOCKED);
let payload = [mode];
frame_payload(buffer, command::SET_MODE, &payload)
}
Expand Down
8 changes: 4 additions & 4 deletions src/responses.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,11 @@ impl SmartAudioReponse for Settings {
channel,
power_level,
frequency,
unlocked,
user_frequency_mode,
pitmode_enabled,
pitmode_in_range_active,
pitmode_out_range_active,
unlocked,
user_frequency_mode,
power_settings,
}
}
Expand Down Expand Up @@ -214,7 +214,7 @@ pub struct ResponseIterator<'a, 'b> {
position: usize,
}

impl<'a, 'b> Iterator for ResponseIterator<'a, 'b> {
impl Iterator for ResponseIterator<'_, '_> {
type Item = Result<Response, SmartAudioError>;

fn next(&mut self) -> Option<Self::Item> {
Expand All @@ -224,7 +224,7 @@ impl<'a, 'b> Iterator for ResponseIterator<'a, 'b> {

match self.parser.push_byte(byte) {
Ok(Some(response)) => return Some(Ok(response)),
Ok(None) => continue, // Continue feeding bytes
Ok(None) => (),
Err(e) => return Some(Err(e)),
}
}
Expand Down