mirror of
https://github.com/spikecodes/libreddit.git
synced 2026-01-25 05:54:06 +01:00
Optimize type casting
This commit is contained in:
@@ -15,7 +15,7 @@ pub async fn handler(req: Request<()>, format: &str, params: Vec<&str>) -> tide:
|
||||
async fn request(url: String) -> tide::Result {
|
||||
match surf::get(url).await {
|
||||
Ok(res) => {
|
||||
let content_length = res.header("Content-Length").map(|v| v.to_string()).unwrap_or_default();
|
||||
let content_length = res.header("Content-Length").map(std::string::ToString::to_string).unwrap_or_default();
|
||||
let content_type = res.content_type().map(|m| m.to_string()).unwrap_or_default();
|
||||
|
||||
Ok(
|
||||
|
||||
Reference in New Issue
Block a user