Skip to content

Commit

Permalink
some small code style optimizations
Browse files Browse the repository at this point in the history
  • Loading branch information
zekroTJA committed Feb 11, 2024
1 parent 5595561 commit 514541a
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/commands/current.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ impl Command for Current {
warning!("No version installed via goup");
match exec(&["go", "version"]) {
Ok(v) => println!("from system: {v}"),
Err(err) if matches!(err, cmd::errors::Error::NotFound) => {
Err(cmd::errors::Error::NotFound) => {
error!("no local go version found");
}
Err(err) => return Err(err.into()),
Expand Down
2 changes: 1 addition & 1 deletion src/env/shared.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const CURRENT_VERSION_FILE: &str = ".current_version";
pub fn get_env_vars(shell: &Shell) -> Result<String> {
let path = std::env::var("PATH")?;

let vars = vec![
let vars = [
(
"PATH",
shell.append_to_path(&path, &shell.path_to_string(get_current_bin_dir()?)?)?,
Expand Down
2 changes: 1 addition & 1 deletion src/versions/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pub(self) mod parser;
mod parser;

mod version;
pub use version::*;
Expand Down
2 changes: 1 addition & 1 deletion src/versions/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ fn get_upstream_versions_git() -> Result<Vec<Version>> {

let res = match res {
Ok(res) => res,
Err(err) if matches!(err, cmd::errors::Error::NotFound) => {
Err(cmd::errors::Error::NotFound) => {
anyhow::bail!(
"Seems you don't have git installed on your system. Listing versions failed."
)
Expand Down

0 comments on commit 514541a

Please sign in to comment.