mirror of
https://github.com/actix/actix-website
synced 2025-06-27 15:39:02 +02:00
clippy
This commit is contained in:
@ -3,7 +3,7 @@ use actix_web::{get, App, HttpRequest, HttpServer, Responder};
|
||||
|
||||
#[get("/")]
|
||||
async fn index(req: HttpRequest) -> impl Responder {
|
||||
let url = req.url_for("youtube", &["oHg5SJYRHA0"]).unwrap();
|
||||
let url = req.url_for("youtube", ["oHg5SJYRHA0"]).unwrap();
|
||||
assert_eq!(url.as_str(), "https://youtube.com/watch/oHg5SJYRHA0");
|
||||
|
||||
url.to_string()
|
||||
|
@ -3,7 +3,7 @@ use actix_web::{get, guard, http::header, HttpRequest, HttpResponse, Result};
|
||||
|
||||
#[get("/test/")]
|
||||
async fn index(req: HttpRequest) -> Result<HttpResponse> {
|
||||
let url = req.url_for("foo", &["1", "2", "3"])?; // <- generate url for "foo" resource
|
||||
let url = req.url_for("foo", ["1", "2", "3"])?; // <- generate url for "foo" resource
|
||||
|
||||
Ok(HttpResponse::Found()
|
||||
.insert_header((header::LOCATION, url.as_str()))
|
||||
|
Reference in New Issue
Block a user