mirror of https://github.com/fafhrd91/actix-web
feat: Add code formatting
This commit is contained in:
parent
4e56ae0594
commit
6f4bdb31f9
|
@ -6,8 +6,7 @@ use std::{
|
||||||
|
|
||||||
use serde::{de, Deserialize};
|
use serde::{de, Deserialize};
|
||||||
|
|
||||||
use crate::resource::ResourceMatchInfo;
|
use crate::{de::PathDeserializer, resource::ResourceMatchInfo, Resource, ResourcePath};
|
||||||
use crate::{de::PathDeserializer, Resource, ResourcePath};
|
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub enum PathItem {
|
pub enum PathItem {
|
||||||
|
|
|
@ -1122,9 +1122,8 @@ pub(crate) fn insert_slash(path: &str) -> Cow<'_, str> {
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use crate::Path;
|
|
||||||
|
|
||||||
use super::*;
|
use super::*;
|
||||||
|
use crate::Path;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn equivalence() {
|
fn equivalence() {
|
||||||
|
|
|
@ -142,7 +142,9 @@ impl<T, U> RouterBuilder<T, U> {
|
||||||
|
|
||||||
/// Finish configuration and create router instance.
|
/// Finish configuration and create router instance.
|
||||||
pub fn finish(self) -> Router<T, U> {
|
pub fn finish(self) -> Router<T, U> {
|
||||||
let max_path_conflicts = self.path_conflicts.iter()
|
let max_path_conflicts = self
|
||||||
|
.path_conflicts
|
||||||
|
.iter()
|
||||||
.map(|(_, path_conflicts)| *path_conflicts)
|
.map(|(_, path_conflicts)| *path_conflicts)
|
||||||
.max()
|
.max()
|
||||||
.unwrap_or(1);
|
.unwrap_or(1);
|
||||||
|
|
|
@ -1,11 +1,10 @@
|
||||||
use std::{cell::RefCell, mem, rc::Rc};
|
use std::{cell::RefCell, mem, rc::Rc};
|
||||||
|
|
||||||
use actix_service::{boxed, fn_service, Service, ServiceFactory};
|
|
||||||
use futures_core::future::LocalBoxFuture;
|
|
||||||
use futures_util::future::join_all;
|
|
||||||
|
|
||||||
use actix_http::Request;
|
use actix_http::Request;
|
||||||
use actix_router::{Path, ResourceDef, Router, Url};
|
use actix_router::{Path, ResourceDef, Router, Url};
|
||||||
|
use actix_service::{boxed, fn_service, Service, ServiceFactory};
|
||||||
|
use futures_core::future::LocalBoxFuture;
|
||||||
|
use futures_util::future::join_all;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
body::BoxBody,
|
body::BoxBody,
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
use std::{cell::RefCell, fmt, future::Future, mem, rc::Rc};
|
use std::{cell::RefCell, fmt, future::Future, mem, rc::Rc};
|
||||||
|
|
||||||
|
use actix_http::{body::MessageBody, Extensions};
|
||||||
|
use actix_router::{ResourceDef, Router};
|
||||||
use actix_service::{
|
use actix_service::{
|
||||||
apply, apply_fn_factory, boxed, IntoServiceFactory, Service, ServiceFactory, ServiceFactoryExt,
|
apply, apply_fn_factory, boxed, IntoServiceFactory, Service, ServiceFactory, ServiceFactoryExt,
|
||||||
Transform,
|
Transform,
|
||||||
|
@ -7,9 +9,6 @@ use actix_service::{
|
||||||
use futures_core::future::LocalBoxFuture;
|
use futures_core::future::LocalBoxFuture;
|
||||||
use futures_util::future::join_all;
|
use futures_util::future::join_all;
|
||||||
|
|
||||||
use actix_http::{body::MessageBody, Extensions};
|
|
||||||
use actix_router::{ResourceDef, Router};
|
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
config::ServiceConfig,
|
config::ServiceConfig,
|
||||||
data::Data,
|
data::Data,
|
||||||
|
@ -553,6 +552,7 @@ mod tests {
|
||||||
use actix_utils::future::ok;
|
use actix_utils::future::ok;
|
||||||
use bytes::Bytes;
|
use bytes::Bytes;
|
||||||
|
|
||||||
|
use super::*;
|
||||||
use crate::{
|
use crate::{
|
||||||
guard,
|
guard,
|
||||||
http::{
|
http::{
|
||||||
|
@ -564,8 +564,6 @@ mod tests {
|
||||||
web, App, HttpMessage, HttpRequest, HttpResponse,
|
web, App, HttpMessage, HttpRequest, HttpResponse,
|
||||||
};
|
};
|
||||||
|
|
||||||
use super::*;
|
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn can_be_returned_from_fn() {
|
fn can_be_returned_from_fn() {
|
||||||
fn my_scope_1() -> Scope {
|
fn my_scope_1() -> Scope {
|
||||||
|
|
Loading…
Reference in New Issue