File tree Expand file tree Collapse file tree 2 files changed +8
-14
lines changed Expand file tree Collapse file tree 2 files changed +8
-14
lines changed Original file line number Diff line number Diff line change @@ -84,13 +84,10 @@ fn main() -> Result<()> {
84
84
85
85
let mut streams = vec ! [ ] ;
86
86
87
- let args: Vec < String > = env:: args ( ) . collect ( ) ;
88
- let base_url;
89
- if args. len ( ) > 1 {
90
- base_url = args[ 1 ] . clone ( ) ;
91
- } else {
92
- base_url = String :: from ( "localhost" ) ;
93
- }
87
+ let base_url = env:: args ( )
88
+ . nth ( 1 )
89
+ . unwrap_or_else ( || String :: from ( "localhost" ) ) ;
90
+
94
91
let addr = format ! ( "{}:8080" , & base_url) ;
95
92
96
93
for i in 0 ..n_events {
Original file line number Diff line number Diff line change @@ -91,13 +91,10 @@ fn main() -> Result<()> {
91
91
92
92
let mut streams = vec ! [ ] ;
93
93
94
- let args: Vec < String > = env:: args ( ) . collect ( ) ;
95
- let base_url;
96
- if args. len ( ) > 1 {
97
- base_url = args[ 1 ] . clone ( ) ;
98
- } else {
99
- base_url = String :: from ( "localhost" ) ;
100
- }
94
+ let base_url = env:: args ( )
95
+ . nth ( 1 )
96
+ . unwrap_or_else ( || String :: from ( "localhost" ) ) ;
97
+
101
98
let addr = format ! ( "{}:8080" , & base_url) ;
102
99
103
100
for i in 0 ..n_events {
You can’t perform that action at this time.
0 commit comments