mirror of
https://gitlab.com/futo-org/fcast.git
synced 2025-08-26 17:22:49 +00:00
rs-terminal: fix clippy warnings
This commit is contained in:
parent
3654a92eb4
commit
212c630383
2 changed files with 9 additions and 6 deletions
|
@ -123,7 +123,8 @@ pub struct MediaItem {
|
||||||
/// Indicates if the receiver should preload the media item
|
/// Indicates if the receiver should preload the media item
|
||||||
pub cache: Option<bool>,
|
pub cache: Option<bool>,
|
||||||
/// Indicates how long the item content is presented on screen in seconds
|
/// 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>
|
/// HTTP request headers to add to the play request Map<string, string>
|
||||||
pub headers: Option<HashMap<String, String>>,
|
pub headers: Option<HashMap<String, String>>,
|
||||||
pub metadata: Option<MetadataObject>,
|
pub metadata: Option<MetadataObject>,
|
||||||
|
@ -160,7 +161,8 @@ pub enum PlaybackState {
|
||||||
#[derive(Serialize, Deserialize, Debug)]
|
#[derive(Serialize, Deserialize, Debug)]
|
||||||
pub struct PlaybackUpdateMessage {
|
pub struct PlaybackUpdateMessage {
|
||||||
// The time the packet was generated (unix time milliseconds)
|
// The time the packet was generated (unix time milliseconds)
|
||||||
pub generationTime: u64,
|
#[serde(rename = "generationTime")]
|
||||||
|
pub generation_time: u64,
|
||||||
// The playback state
|
// The playback state
|
||||||
pub state: PlaybackState,
|
pub state: PlaybackState,
|
||||||
// The current time playing in seconds
|
// The current time playing in seconds
|
||||||
|
@ -170,7 +172,8 @@ pub struct PlaybackUpdateMessage {
|
||||||
// The playback speed factor
|
// The playback speed factor
|
||||||
pub speed: Option<f64>,
|
pub speed: Option<f64>,
|
||||||
// The playlist item index currently being played on receiver
|
// The playlist item index currently being played on receiver
|
||||||
pub itemIndex: Option<u64>,
|
#[serde(rename = "itemIndex")]
|
||||||
|
pub item_index: Option<u64>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Debug)]
|
#[derive(Serialize, Debug)]
|
||||||
|
@ -568,7 +571,7 @@ mod tests {
|
||||||
volume: None,
|
volume: None,
|
||||||
speed: None,
|
speed: None,
|
||||||
cache: None,
|
cache: None,
|
||||||
showDuration: None,
|
show_duration: None,
|
||||||
headers: None,
|
headers: None,
|
||||||
metadata: None,
|
metadata: None,
|
||||||
};
|
};
|
||||||
|
|
|
@ -53,8 +53,8 @@ where
|
||||||
let bytes_to_read = buf.len().min(self.buffer.len());
|
let bytes_to_read = buf.len().min(self.buffer.len());
|
||||||
assert!(buf.len() >= bytes_to_read);
|
assert!(buf.len() >= bytes_to_read);
|
||||||
assert!(self.buffer.len() >= bytes_to_read);
|
assert!(self.buffer.len() >= bytes_to_read);
|
||||||
for i in 0..bytes_to_read {
|
for b in buf.iter_mut().take(bytes_to_read) {
|
||||||
buf[i] = self.buffer.pop_front().unwrap(); // Safe unwrap as bounds was checked previously
|
*b = self.buffer.pop_front().unwrap(); // Safe unwrap as bounds was checked previously
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
match self.inner.read() {
|
match self.inner.read() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue