Compare commits

..

No commits in common. "f7504ac0418945ec1caed5ecc1fae076698f584d" and "78a6a89988f08b71c86e217ff6861391eb4fddb0" have entirely different histories.

View file

@ -90,12 +90,12 @@ pub fn parse_args_1(arg: &String) -> String{
pub fn parse_args_2(arg: &String) -> String{ pub fn parse_args_2(arg: &String) -> String{
const POSSIBLE: &'static [&'static str] = &["start", "stop", "reload", "restart", "shutdown", "force-stop", "force-reload", "force-restart", "force-shutdown", "try-restart"]; let possible: Vec<&str> = vec!["start", "stop", "reload", "restart", "shutdown", "force-stop", "force-reload", "force-restart", "force-shutdown", "try-restart"];
const CPOSSIBLE: &'static [char] = &['s', 'u', 'd', 'o', 'p', 'c', 'h', 'a', 'i', 'q', '1', '2', 't', 'k']; let cpossible: Vec<char> = vec!['s', 'u', 'd', 'o', 'p', 'c', 'h', 'a', 'i', 'q', '1', '2', 't', 'k'];
for var in POSSIBLE.iter() { for var in possible.iter() {
if arg == var { if arg == var {
return var.to_string() return var.to_string()
} }
@ -105,7 +105,7 @@ pub fn parse_args_2(arg: &String) -> String{
let ch1 = arg.chars().next().unwrap(); let ch1 = arg.chars().next().unwrap();
for var in CPOSSIBLE.iter() { for var in cpossible.iter() {
if ch1 == *var { if ch1 == *var {
return ch1.to_string() return ch1.to_string()
} }