We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 04d893c + 5295d8c commit 5e117d2Copy full SHA for 5e117d2
delayserver/src/main.rs
@@ -31,13 +31,10 @@ async fn delay(path: web::Path<(u64, String)>) -> impl Responder {
31
32
#[actix_web::main]
33
async fn main() -> std::io::Result<()> {
34
- let args: Vec<String> = env::args().collect();
35
- let url;
36
- if args.len() > 1 {
37
- url = args[1].clone();
38
- } else {
39
- url = String::from("localhost");
40
- }
+ let url = env::args()
+ .nth(1)
+ .unwrap_or_else(|| String::from("localhost"));
+
41
println!("{EXPLANATION}");
42
HttpServer::new(|| {
43
App::new()
0 commit comments