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<()> {
8484
8585 let mut streams = vec ! [ ] ;
8686
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+
9491 let addr = format ! ( "{}:8080" , & base_url) ;
9592
9693 for i in 0 ..n_events {
Original file line number Diff line number Diff line change @@ -91,13 +91,10 @@ fn main() -> Result<()> {
9191
9292 let mut streams = vec ! [ ] ;
9393
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+
10198 let addr = format ! ( "{}:8080" , & base_url) ;
10299
103100 for i in 0 ..n_events {
You can’t perform that action at this time.
0 commit comments