Skip to content

Commit a3de3b3

Browse files
committed
Format code
1 parent 020eb9a commit a3de3b3

File tree

2 files changed

+17
-32
lines changed

2 files changed

+17
-32
lines changed

src/media/streaming.rs

+16-31
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,9 @@ impl Stream {
4242
raw_streams
4343
.adaptive_hls
4444
.as_ref()
45-
.map_or(
46-
Err(Error::Input {
47-
message: "no stream available".to_string(),
48-
}),
49-
Ok,
50-
)?
45+
.ok_or(Error::Input {
46+
message: "no stream available".to_string(),
47+
})?
5148
.url
5249
.clone(),
5350
)
@@ -63,12 +60,9 @@ impl Stream {
6360
raw_streams
6461
.adaptive_hls
6562
.as_ref()
66-
.map_or(
67-
Err(Error::Input {
68-
message: "no stream available".to_string(),
69-
}),
70-
Ok,
71-
)?
63+
.ok_or(Error::Input {
64+
message: "no stream available".to_string(),
65+
})?
7266
.url
7367
.clone(),
7468
)
@@ -79,12 +73,9 @@ impl Stream {
7973
raw_streams
8074
.adaptive_hls
8175
.as_ref()
82-
.map_or(
83-
Err(Error::Input {
84-
message: "no stream available".to_string(),
85-
}),
86-
Ok,
87-
)?
76+
.ok_or(Error::Input {
77+
message: "no stream available".to_string(),
78+
})?
8879
.url
8980
.clone(),
9081
)
@@ -124,12 +115,9 @@ impl Stream {
124115
raw_streams
125116
.adaptive_dash
126117
.as_ref()
127-
.map_or(
128-
Err(Error::Input {
129-
message: "no stream available".to_string(),
130-
}),
131-
Ok,
132-
)?
118+
.ok_or(Error::Input {
119+
message: "no stream available".to_string(),
120+
})?
133121
.url
134122
.clone()
135123
} else {
@@ -141,12 +129,9 @@ impl Stream {
141129
raw_streams
142130
.adaptive_dash
143131
.as_ref()
144-
.map_or(
145-
Err(Error::Input {
146-
message: "no stream available".to_string(),
147-
}),
148-
Ok,
149-
)?
132+
.ok_or(Error::Input {
133+
message: "no stream available".to_string(),
134+
})?
150135
.url
151136
.clone()
152137
} else {
@@ -388,7 +373,7 @@ impl VariantData {
388373
id: representation.id.expect("dash representation id"),
389374
base: representation
390375
.BaseURL
391-
.get(0)
376+
.first()
392377
.expect("dash base url")
393378
.base
394379
.clone(),

src/rating/comment.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ where
324324
match flags.len() {
325325
0 => Ok(false),
326326
1 => {
327-
if flags.get(0).unwrap() == "spoiler" {
327+
if flags[0] == "spoiler" {
328328
Ok(true)
329329
} else {
330330
Err(Error::custom(format!(

0 commit comments

Comments
 (0)