diff --git a/src/config.rs b/src/config.rs index 48631e3..4e5f521 100644 --- a/src/config.rs +++ b/src/config.rs @@ -24,6 +24,7 @@ impl Config { }; // takes `Some(Vec<&str>)` and returns `Vec<&str>` + // checks to make sure the package manager supports the action let mut prog = match get { None => { println!("Sorry, your package manager does not support this action"); @@ -34,8 +35,9 @@ impl Config { //Pop's from the front of the `Vec<&str>`, which should always be the command name let command = prog.remove(0); - // Matches against a tuple of the first element of the `Vec` and the `&Option` - // from the passed `Config`, taking a reference to that data when it needs it. + // Tuple match, `prog.first()` returns an `Option` on the first element of + // a Vec, `self.term` is also an `Option` so this checks both for `Some`/`None` + // and formats the program as needed match (prog.first(), &self.term) { (None, &None) => { let mut child = Command::new(&command).spawn().expect(