Skip to content

Commit

Permalink
Format code
Browse files Browse the repository at this point in the history
  • Loading branch information
bytedream committed Feb 23, 2024
1 parent 020eb9a commit a3de3b3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 32 deletions.
47 changes: 16 additions & 31 deletions src/media/streaming.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,9 @@ impl Stream {
raw_streams
.adaptive_hls
.as_ref()
.map_or(
Err(Error::Input {
message: "no stream available".to_string(),
}),
Ok,
)?
.ok_or(Error::Input {
message: "no stream available".to_string(),
})?
.url
.clone(),
)
Expand All @@ -63,12 +60,9 @@ impl Stream {
raw_streams
.adaptive_hls
.as_ref()
.map_or(
Err(Error::Input {
message: "no stream available".to_string(),
}),
Ok,
)?
.ok_or(Error::Input {
message: "no stream available".to_string(),
})?
.url
.clone(),
)
Expand All @@ -79,12 +73,9 @@ impl Stream {
raw_streams
.adaptive_hls
.as_ref()
.map_or(
Err(Error::Input {
message: "no stream available".to_string(),
}),
Ok,
)?
.ok_or(Error::Input {
message: "no stream available".to_string(),
})?
.url
.clone(),
)
Expand Down Expand Up @@ -124,12 +115,9 @@ impl Stream {
raw_streams
.adaptive_dash
.as_ref()
.map_or(
Err(Error::Input {
message: "no stream available".to_string(),
}),
Ok,
)?
.ok_or(Error::Input {
message: "no stream available".to_string(),
})?
.url
.clone()
} else {
Expand All @@ -141,12 +129,9 @@ impl Stream {
raw_streams
.adaptive_dash
.as_ref()
.map_or(
Err(Error::Input {
message: "no stream available".to_string(),
}),
Ok,
)?
.ok_or(Error::Input {
message: "no stream available".to_string(),
})?
.url
.clone()
} else {
Expand Down Expand Up @@ -388,7 +373,7 @@ impl VariantData {
id: representation.id.expect("dash representation id"),
base: representation
.BaseURL
.get(0)
.first()
.expect("dash base url")
.base
.clone(),
Expand Down
2 changes: 1 addition & 1 deletion src/rating/comment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ where
match flags.len() {
0 => Ok(false),
1 => {
if flags.get(0).unwrap() == "spoiler" {
if flags[0] == "spoiler" {
Ok(true)
} else {
Err(Error::custom(format!(
Expand Down

0 comments on commit a3de3b3

Please sign in to comment.