Skip to content

Commit 6d00552

Browse files
Tweak
1 parent 3ff0e8e commit 6d00552

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

src/record/mod.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
use anyhow::anyhow;
22
use chrono::{DateTime, Utc};
3-
use futures::future::{BoxFuture, FutureExt};
3+
use futures::future::{BoxFuture, FutureExt, TryFutureExt};
44
use futures::stream::{StreamExt, TryStreamExt, iter};
55
use m3u8_rs::*;
6-
use reqwest::Client;
76
use reqwest::header::HeaderMap;
7+
use reqwest::{Client, Response};
88
use std::io;
99
use std::path::{Path, PathBuf};
1010
use std::sync::Arc;
@@ -344,9 +344,7 @@ async fn download_playlist(client: &Client, url: &Url) -> Result<String, RecordE
344344
client
345345
.get(url.clone())
346346
.send()
347-
.await
348-
.map_err(|e| RecordError::Io(io::Error::other(e)))?
349-
.text()
347+
.and_then(Response::text)
350348
.await
351349
.map_err(|e| RecordError::Io(io::Error::other(e)))
352350
}

0 commit comments

Comments
 (0)