From 6f06c222c74ac0545624943dd68608f6c7b64b34 Mon Sep 17 00:00:00 2001 From: rakeshksr Date: Wed, 14 Feb 2024 11:13:18 +0530 Subject: [PATCH 1/6] short channel matching --- src/bin/julialauncher.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/bin/julialauncher.rs b/src/bin/julialauncher.rs index 62c1ce17..78041caa 100644 --- a/src/bin/julialauncher.rs +++ b/src/bin/julialauncher.rs @@ -305,7 +305,14 @@ fn run_app() -> Result { let first_arg = &args[1]; if let Some(stripped) = first_arg.strip_prefix('+') { - channel_from_cmd_line = Some(stripped.to_string()); + channel_from_cmd_line = match stripped { + "a" => Some("alpha".to_string()), + "b" => Some("beta".to_string()), + "l" => Some("lts".to_string()), + "n" => Some("nightly".to_string()), + "r" => Some("release".to_string()), + strip => Some(strip.to_string()) + } } } From 8e5b30ac12432c35083fc4dfa5220fabb1ce3763 Mon Sep 17 00:00:00 2001 From: rakeshksr Date: Wed, 14 Feb 2024 11:31:55 +0530 Subject: [PATCH 2/6] format code --- src/bin/julialauncher.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bin/julialauncher.rs b/src/bin/julialauncher.rs index 78041caa..49906a57 100644 --- a/src/bin/julialauncher.rs +++ b/src/bin/julialauncher.rs @@ -311,7 +311,7 @@ fn run_app() -> Result { "l" => Some("lts".to_string()), "n" => Some("nightly".to_string()), "r" => Some("release".to_string()), - strip => Some(strip.to_string()) + strip => Some(strip.to_string()), } } } From 23af026cd210cb8787ff5ffc02888bfff140f15f Mon Sep 17 00:00:00 2001 From: Lilith Orion Hafner Date: Wed, 3 Jul 2024 16:01:11 +0000 Subject: [PATCH 3/6] Factor out `Some` constructor --- src/bin/julialauncher.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/bin/julialauncher.rs b/src/bin/julialauncher.rs index 49906a57..c42acc4a 100644 --- a/src/bin/julialauncher.rs +++ b/src/bin/julialauncher.rs @@ -305,14 +305,14 @@ fn run_app() -> Result { let first_arg = &args[1]; if let Some(stripped) = first_arg.strip_prefix('+') { - channel_from_cmd_line = match stripped { - "a" => Some("alpha".to_string()), - "b" => Some("beta".to_string()), - "l" => Some("lts".to_string()), - "n" => Some("nightly".to_string()), - "r" => Some("release".to_string()), - strip => Some(strip.to_string()), - } + channel_from_cmd_line = Some(match stripped { + "a" => "alpha".to_string(), + "b" => "beta".to_string(), + "l" => "lts".to_string(), + "n" => "nightly".to_string(), + "r" => "release".to_string(), + strip => strip.to_string(), + }) } } From 806d8a6607d184cbb435d919abbe4b5ff25b32f1 Mon Sep 17 00:00:00 2001 From: Lilith Orion Hafner Date: Wed, 3 Jul 2024 16:07:24 +0000 Subject: [PATCH 4/6] Factor out `.to_string()` --- src/bin/julialauncher.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/bin/julialauncher.rs b/src/bin/julialauncher.rs index c42acc4a..dbae0881 100644 --- a/src/bin/julialauncher.rs +++ b/src/bin/julialauncher.rs @@ -306,13 +306,13 @@ fn run_app() -> Result { if let Some(stripped) = first_arg.strip_prefix('+') { channel_from_cmd_line = Some(match stripped { - "a" => "alpha".to_string(), - "b" => "beta".to_string(), - "l" => "lts".to_string(), - "n" => "nightly".to_string(), - "r" => "release".to_string(), - strip => strip.to_string(), - }) + "a" => "alpha", + "b" => "beta", + "l" => "lts", + "n" => "nightly", + "r" => "release", + strip => strip, + }.to_string()) } } From 20101c731c8743e5e61eaaa87ca0438acab7a16b Mon Sep 17 00:00:00 2001 From: Lilith Orion Hafner Date: Wed, 3 Jul 2024 16:10:50 +0000 Subject: [PATCH 5/6] Formatting --- src/bin/julialauncher.rs | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/bin/julialauncher.rs b/src/bin/julialauncher.rs index dbae0881..4fe05d88 100644 --- a/src/bin/julialauncher.rs +++ b/src/bin/julialauncher.rs @@ -305,14 +305,17 @@ fn run_app() -> Result { let first_arg = &args[1]; if let Some(stripped) = first_arg.strip_prefix('+') { - channel_from_cmd_line = Some(match stripped { - "a" => "alpha", - "b" => "beta", - "l" => "lts", - "n" => "nightly", - "r" => "release", - strip => strip, - }.to_string()) + channel_from_cmd_line = Some( + match stripped { + "a" => "alpha", + "b" => "beta", + "l" => "lts", + "n" => "nightly", + "r" => "release", + strip => strip, + } + .to_string() + ) } } From 72315951525e4ff99d946a0d3b3457faba127cb6 Mon Sep 17 00:00:00 2001 From: Lilith Orion Hafner Date: Wed, 3 Jul 2024 16:12:23 +0000 Subject: [PATCH 6/6] Add unnecessary comma for format check --- src/bin/julialauncher.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bin/julialauncher.rs b/src/bin/julialauncher.rs index 4fe05d88..352178d7 100644 --- a/src/bin/julialauncher.rs +++ b/src/bin/julialauncher.rs @@ -314,7 +314,7 @@ fn run_app() -> Result { "r" => "release", strip => strip, } - .to_string() + .to_string(), ) } }