Skip to content

Commit fe42615

Browse files
committed
Fixed private video crash issue
1 parent b40977f commit fe42615

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/tasks/download.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,15 @@ pub async fn download<P: AsRef<std::path::Path>>(
4343
sender: Sender<SoundAction>,
4444
) -> Result<(), VideoError> {
4545
use std::io::Write;
46-
let stream = video.stream().await.unwrap();
46+
let stream = video.stream().await?;
4747

4848
let length = stream.content_length();
4949

5050
let mut file =
5151
std::fs::File::create(path).map_err(|e| VideoError::DownloadError(e.to_string()))?;
5252

5353
let mut total = 0;
54-
while let Some(chunk) = stream.chunk().await.unwrap() {
54+
while let Some(chunk) = stream.chunk().await? {
5555
total += chunk.len();
5656

5757
sender

0 commit comments

Comments
 (0)