We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b40977f commit fe42615Copy full SHA for fe42615
src/tasks/download.rs
@@ -43,15 +43,15 @@ pub async fn download<P: AsRef<std::path::Path>>(
43
sender: Sender<SoundAction>,
44
) -> Result<(), VideoError> {
45
use std::io::Write;
46
- let stream = video.stream().await.unwrap();
+ let stream = video.stream().await?;
47
48
let length = stream.content_length();
49
50
let mut file =
51
std::fs::File::create(path).map_err(|e| VideoError::DownloadError(e.to_string()))?;
52
53
let mut total = 0;
54
- while let Some(chunk) = stream.chunk().await.unwrap() {
+ while let Some(chunk) = stream.chunk().await? {
55
total += chunk.len();
56
57
sender
0 commit comments