mirror of
https://github.com/actix/examples
synced 2025-06-26 17:17:42 +02:00
s/str::to_string/str::to_owned
This commit is contained in:
@ -77,10 +77,10 @@ fn get_error_response<B>(res: &ServiceResponse<B>, error: &str) -> HttpResponse<
|
||||
|
||||
// Provide a fallback to a simple plain text response in case an error occurs during the
|
||||
// rendering of the error page.
|
||||
let fallback = |e: &str| {
|
||||
let fallback = |err: &str| {
|
||||
HttpResponse::build(res.status())
|
||||
.content_type(ContentType::plaintext())
|
||||
.body(e.to_string())
|
||||
.body(err.to_string())
|
||||
};
|
||||
|
||||
let hb = request
|
||||
|
@ -38,7 +38,7 @@ async fn page(params: web::Path<(i32,)>) -> actix_web::Result<impl Responder> {
|
||||
|
||||
#[get("/")]
|
||||
async fn hello() -> impl Responder {
|
||||
Html("<p>Hello world!</p>".to_string())
|
||||
Html("<p>Hello world!</p>".to_owned())
|
||||
}
|
||||
|
||||
#[actix_web::main]
|
||||
|
@ -71,10 +71,10 @@ fn get_error_response<B>(res: &ServiceResponse<B>, error: &str) -> HttpResponse
|
||||
|
||||
// Provide a fallback to a simple plain text response in case an error occurs during the
|
||||
// rendering of the error page.
|
||||
let fallback = |e: &str| {
|
||||
let fallback = |err: &str| {
|
||||
HttpResponse::build(res.status())
|
||||
.content_type(ContentType::plaintext())
|
||||
.body(e.to_string())
|
||||
.body(err.to_string())
|
||||
};
|
||||
|
||||
let tera = request.app_data::<web::Data<Tera>>().map(|t| t.get_ref());
|
||||
|
@ -75,10 +75,10 @@ fn get_error_response<B>(res: &ServiceResponse<B>, error: &str) -> HttpResponse
|
||||
|
||||
// Provide a fallback to a simple plain text response in case an error occurs during the
|
||||
// rendering of the error page.
|
||||
let fallback = |e: &str| {
|
||||
let fallback = |err: &str| {
|
||||
HttpResponse::build(res.status())
|
||||
.content_type(ContentType::plaintext())
|
||||
.body(e.to_string())
|
||||
.body(err.to_string())
|
||||
};
|
||||
|
||||
let tt = request
|
||||
|
Reference in New Issue
Block a user