Skip to content

Commit

Permalink
fix lint (#205)
Browse files Browse the repository at this point in the history
  • Loading branch information
justjavac authored Nov 15, 2024
1 parent c08fff5 commit d65e353
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 1 addition & 4 deletions src/commands/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,7 @@ pub fn exec_remote() -> Result<()> {
}

fn print_versions(mut versions: Vec<String>) {
let current_version = match current_version() {
Some(v) => v,
_ => String::from(""),
};
let current_version = current_version().unwrap_or_default();

versions.sort_by(|a, b| sort_semver_version(b, a).reverse());

Expand Down
2 changes: 2 additions & 0 deletions src/meta.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ pub const DEFAULT_ALIAS: phf::Map<&'static str, &'static str> = phf::phf_map! {
};

pub trait ToVersionReq {
#[allow(dead_code)]
fn to_version_req(&self) -> VersionReq;
fn try_to_version_req(&self) -> anyhow::Result<VersionReq>;
}
Expand Down Expand Up @@ -334,6 +335,7 @@ mod tests {
assert_eq!(parsed.versions.len(), 2);
assert_eq!(parsed.alias[0].name, "latest");
assert_eq!(parsed.alias[0].required, "*");
assert_eq!(parsed.alias[0].to_version_req(), VersionReq::parse("*").unwrap());
assert!(parsed.alias[0].try_to_version_req().is_ok());
assert_eq!(parsed.alias[1].name, "stable");
assert_eq!(parsed.alias[1].required, "^1.0.0");
Expand Down

0 comments on commit d65e353

Please sign in to comment.