Conversation
| use reqwest::{Body, Client, Method, Request, Url}; | ||
| use serde_json::Value; | ||
| use std::error::Error; | ||
| use std::str::FromStr; |
There was a problem hiding this comment.
unused import: std::str::FromStr
| .and_then(|v| v.as_array()) | ||
| .map(|arr| { | ||
| arr.iter() | ||
| .filter_map(|item| parse_format_id_from_json(item)) |
There was a problem hiding this comment.
redundant closure
| .and_then(|v| v.as_array()) | ||
| .map(|arr| { | ||
| arr.iter() | ||
| .filter_map(|item| parse_format_id_from_json(item)) |
There was a problem hiding this comment.
redundant closure
| .and_then(|v| v.as_array()) | ||
| .map(|arr| { | ||
| arr.iter() | ||
| .filter_map(|item| parse_buffered_range_from_json(item)) |
There was a problem hiding this comment.
redundant closure
| } | ||
|
|
||
| #[derive(Debug, Clone)] | ||
| pub struct Sequence { |
There was a problem hiding this comment.
multiple fields are never read
| } | ||
|
|
||
| #[derive(Debug, Clone)] | ||
| pub struct InitializedFormat { |
There was a problem hiding this comment.
fields format_id, duration_ms, and sequence_count are never read
| } | ||
|
|
||
| #[derive(Debug, Clone)] | ||
| pub struct SabrResponse { |
There was a problem hiding this comment.
fields stream_protection_status, sabr_redirect, sabr_error, and next_request_policy are never read
| } | ||
|
|
||
| #[derive(Debug)] | ||
| pub struct UmpPart { |
There was a problem hiding this comment.
field size is never read
| + 16 * (byte2 as i32 + 256 * (byte3 as i32 + 256 * byte4 as i32)) | ||
| } | ||
| _ => { | ||
| let value = u32::from_le_bytes([data[1], data[2], data[3], data[4]]) as i32; |
There was a problem hiding this comment.
returning the result of a let binding from a block
|
|
||
| fn get_client_info_from_query(query: &QString) -> ClientInfo { | ||
| // Extract client info from query parameters | ||
| let client_name = query.get("c").and_then(|c| match c { |
There was a problem hiding this comment.
using Option.and_then(|x| Some(y)), which is more succinctly expressed as map(|x| y)
| pub buffered_ranges: Vec<BufferedRange>, | ||
| } | ||
|
|
||
| impl SabrRequestBuilder { |
There was a problem hiding this comment.
methods with_resolution, with_visibility, and encode are never used
This doesn't work yet.