1
0
Fork 0
mirror of https://gitlab.com/futo-org/fcast.git synced 2025-08-26 09:12:49 +00:00

rs-terminal: fix clippy warnings

This commit is contained in:
Marcus Hanestad 2025-06-04 14:11:29 +02:00
parent 3654a92eb4
commit 212c630383
2 changed files with 9 additions and 6 deletions

View file

@ -123,7 +123,8 @@ pub struct MediaItem {
/// Indicates if the receiver should preload the media item
pub cache: Option<bool>,
/// Indicates how long the item content is presented on screen in seconds
pub showDuration: Option<f64>,
#[serde(rename = "showDuration")]
pub show_duration: Option<f64>,
/// HTTP request headers to add to the play request Map<string, string>
pub headers: Option<HashMap<String, String>>,
pub metadata: Option<MetadataObject>,
@ -160,7 +161,8 @@ pub enum PlaybackState {
#[derive(Serialize, Deserialize, Debug)]
pub struct PlaybackUpdateMessage {
// The time the packet was generated (unix time milliseconds)
pub generationTime: u64,
#[serde(rename = "generationTime")]
pub generation_time: u64,
// The playback state
pub state: PlaybackState,
// The current time playing in seconds
@ -170,7 +172,8 @@ pub struct PlaybackUpdateMessage {
// The playback speed factor
pub speed: Option<f64>,
// The playlist item index currently being played on receiver
pub itemIndex: Option<u64>,
#[serde(rename = "itemIndex")]
pub item_index: Option<u64>,
}
#[derive(Serialize, Debug)]
@ -568,7 +571,7 @@ mod tests {
volume: None,
speed: None,
cache: None,
showDuration: None,
show_duration: None,
headers: None,
metadata: None,
};

View file

@ -53,8 +53,8 @@ where
let bytes_to_read = buf.len().min(self.buffer.len());
assert!(buf.len() >= bytes_to_read);
assert!(self.buffer.len() >= bytes_to_read);
for i in 0..bytes_to_read {
buf[i] = self.buffer.pop_front().unwrap(); // Safe unwrap as bounds was checked previously
for b in buf.iter_mut().take(bytes_to_read) {
*b = self.buffer.pop_front().unwrap(); // Safe unwrap as bounds was checked previously
}
} else {
match self.inner.read() {