diff --git a/actix-http/src/header/shared/quality_item.rs b/actix-http/src/header/shared/quality_item.rs index f35dd864d..e720545a1 100644 --- a/actix-http/src/header/shared/quality_item.rs +++ b/actix-http/src/header/shared/quality_item.rs @@ -99,8 +99,8 @@ impl str::FromStr for QualityItem { let mut raw_item = q_item_str; let mut quality = Quality::MAX; - let parts = str_rsplit_once(q_item_str, ';') - .map(|(item, q_attr)| (item.trim(), q_attr.trim())); + let parts = + str_rsplit_once(q_item_str, ';').map(|(item, q_attr)| (item.trim(), q_attr.trim())); if let Some((val, q_attr)) = parts { // example for item with q-factor: diff --git a/src/error/internal.rs b/src/error/internal.rs index 7ff52567e..f9c1ef510 100644 --- a/src/error/internal.rs +++ b/src/error/internal.rs @@ -123,7 +123,11 @@ macro_rules! error_helper { error_helper!( $name, $status, - concat!("Helper function that wraps any error and generates a `", stringify!($status), "` response.") + concat!( + "Helper function that wraps any error and generates a `", + stringify!($status), + "` response." + ) ); }; ($name:ident, $status:ident, $doc:expr) => { diff --git a/src/guard.rs b/src/guard.rs index d4117bfab..18f34e491 100644 --- a/src/guard.rs +++ b/src/guard.rs @@ -295,8 +295,16 @@ macro_rules! method_guard { method_guard!( $method_fn, $method_const, - concat!("Creates a guard that matches the `", stringify!($method_const), "` request method."), - concat!("The route in this example will only respond to `", stringify!($method_const), "` requests."), + concat!( + "Creates a guard that matches the `", + stringify!($method_const), + "` request method." + ), + concat!( + "The route in this example will only respond to `", + stringify!($method_const), + "` requests." + ), concat!(" .guard(guard::", stringify!($method_fn), "())") ); }; diff --git a/src/web.rs b/src/web.rs index b61a4a599..7ae9479a4 100644 --- a/src/web.rs +++ b/src/web.rs @@ -83,7 +83,6 @@ pub fn route() -> Route { Route::new() } - macro_rules! method_route { // Workaround for 1.52.0 compat. It's not great but any use of `concat!` must be done prior // to insertion in a doc comment. @@ -91,9 +90,21 @@ macro_rules! method_route { method_route!( $method_fn, $method_const, - concat!(" Creates a new route with `", stringify!($method_const), "` method guard."), - concat!(" In this example, one `", stringify!($method_const), " /{project_id}` route is set up:"), - concat!(" .route(web::", stringify!($method_fn), "().to(|| HttpResponse::Ok()))") + concat!( + " Creates a new route with `", + stringify!($method_const), + "` method guard." + ), + concat!( + " In this example, one `", + stringify!($method_const), + " /{project_id}` route is set up:" + ), + concat!( + " .route(web::", + stringify!($method_fn), + "().to(|| HttpResponse::Ok()))" + ) ); }; ($method_fn:ident, $method_const:ident, $doc1:expr, $doc2:expr, $doc3:expr) => { @@ -113,7 +124,7 @@ macro_rules! method_route { pub fn $method_fn() -> Route { method(Method::$method_const) } - } + }; } method_route!(get, GET);