File tree Expand file tree Collapse file tree 5 files changed +7
-7
lines changed Expand file tree Collapse file tree 5 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ async fn main() {
17
17
let router = Router :: new ( )
18
18
. get ( hello)
19
19
. push ( Router :: with_path ( "你好" ) . get ( hello_zh) ) ;
20
- println ! ( "{:?}" , router ) ;
20
+ println ! ( "{router :?}" ) ;
21
21
Server :: new ( acceptor)
22
22
. fuse_factory ( salvo:: fuse:: flex:: FlexFactory :: new ( ) )
23
23
. serve ( router)
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ async fn main() {
28
28
. push ( Router :: with_path ( "你好" ) . get ( hello_zh) ) ;
29
29
30
30
// Print router structure for debugging
31
- println ! ( "{:?}" , router ) ;
31
+ println ! ( "{router :?}" ) ;
32
32
33
33
// Start serving requests
34
34
Server :: new ( acceptor) . serve ( router) . await ;
Original file line number Diff line number Diff line change @@ -11,19 +11,19 @@ struct MyObject<T: ToSchema + std::fmt::Debug + 'static> {
11
11
/// Use string type, this will add to openapi doc.
12
12
#[ endpoint]
13
13
async fn use_string ( body : JsonBody < MyObject < String > > ) -> String {
14
- format ! ( "{:?}" , body )
14
+ format ! ( "{body :?}" )
15
15
}
16
16
17
17
/// Use i32 type, this will add to openapi doc.
18
18
#[ endpoint]
19
19
async fn use_i32 ( body : JsonBody < MyObject < i32 > > ) -> String {
20
- format ! ( "{:?}" , body )
20
+ format ! ( "{body :?}" )
21
21
}
22
22
23
23
/// Use u64 type, this will add to openapi doc.
24
24
#[ endpoint]
25
25
async fn use_u64 ( body : JsonBody < MyObject < u64 > > ) -> String {
26
- format ! ( "{:?}" , body )
26
+ format ! ( "{body :?}" )
27
27
}
28
28
29
29
#[ tokio:: main]
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ async fn main() {
9
9
vec ! [ "http://localhost:3000" ] ,
10
10
HyperClient :: default ( ) ,
11
11
) ) ;
12
- println ! ( "{:?}" , router ) ;
12
+ println ! ( "{router :?}" ) ;
13
13
14
14
let acceptor = TcpListener :: new ( "0.0.0.0:5800" ) . bind ( ) . await ;
15
15
Server :: new ( acceptor) . serve ( router) . await ;
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ async fn main() {
9
9
vec ! [ "http://localhost:5800" ] ,
10
10
HyperClient :: default ( ) ,
11
11
) ) ;
12
- println ! ( "{:?}" , router ) ;
12
+ println ! ( "{router :?}" ) ;
13
13
tracing:: info!( "Run `cargo run --bin example-websocket-chat` to start websocket chat server" ) ;
14
14
let acceptor = TcpListener :: new ( "0.0.0.0:8888" ) . bind ( ) . await ;
15
15
Server :: new ( acceptor) . serve ( router) . await ;
You can’t perform that action at this time.
0 commit comments