diff --git a/Cargo.lock b/Cargo.lock index 86898b5..2fc358c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1332,7 +1332,7 @@ checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" [[package]] name = "svm-rs" -version = "0.2.19" +version = "0.2.20" dependencies = [ "anyhow", "cfg-if", @@ -1361,7 +1361,7 @@ dependencies = [ [[package]] name = "svm-rs-builds" -version = "0.1.10" +version = "0.1.12" dependencies = [ "build_const", "hex", diff --git a/Cargo.toml b/Cargo.toml index 32f0ee6..ec495ca 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "svm-rs" -version = "0.2.19" +version = "0.2.20" edition = "2018" authors = ["Rohit Narurkar "] license = "MIT OR Apache-2.0" diff --git a/list/linux-aarch64.json b/list/linux-aarch64.json index 23e30a4..dcb9553 100644 --- a/list/linux-aarch64.json +++ b/list/linux-aarch64.json @@ -195,6 +195,10 @@ { "version": "0.8.17", "sha256": "e905b3d7f785f660f3c573c1641f42d11be0b4daae79c37e23b72fa2df808098" + }, + { + "version": "0.8.18", + "sha256": "d0bb39a5fbcac77b315ea0d9cf48c6882de5b6bcb716be2197355722f24f2ee8" } ], "releases": { @@ -246,6 +250,7 @@ "0.8.14": "solc-v0.8.14", "0.8.15": "solc-v0.8.15", "0.8.16": "solc-v0.8.16", - "0.8.17": "solc-v0.8.17" + "0.8.17": "solc-v0.8.17", + "0.8.18": "solc-v0.8.18" } } diff --git a/src/lib.rs b/src/lib.rs index 63bee48..9ae91af 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -380,7 +380,7 @@ impl Drop for LockFile { /// Returns the lockfile to use for a specific file fn lock_file_path(version: &Version) -> PathBuf { - SVM_HOME.join(format!(".lock-solc-{}", version)) + SVM_HOME.join(format!(".lock-solc-{version}")) } #[cfg(test)] @@ -403,8 +403,7 @@ mod tests { assert_eq!( artifact_url(Platform::LinuxAarch64, &version, artifact).unwrap(), Url::parse(&format!( - "https://github.com/nikitastupin/solc/raw/bd9079b31dd4cb06a98cd3c76b3c3d3ab956de5e/linux/aarch64/{}", - artifact + "https://github.com/nikitastupin/solc/raw/01a11efffb8111db0637d4b47a8360bb66979d82/linux/aarch64/{artifact}" )) .unwrap(), ) @@ -436,9 +435,8 @@ mod tests { async fn test_version() { let version = "0.8.10".parse().unwrap(); install(&version).await.unwrap(); - let solc_path = - version_path(version.to_string().as_str()).join(&format!("solc-{}", version)); - let output = Command::new(&solc_path) + let solc_path = version_path(version.to_string().as_str()).join(format!("solc-{version}")); + let output = Command::new(solc_path) .arg("--version") .stdin(Stdio::piped()) .stderr(Stdio::piped()) @@ -456,9 +454,8 @@ mod tests { fn blocking_test_version() { let version = "0.8.10".parse().unwrap(); blocking_install(&version).unwrap(); - let solc_path = - version_path(version.to_string().as_str()).join(&format!("solc-{}", version)); - let output = Command::new(&solc_path) + let solc_path = version_path(version.to_string().as_str()).join(format!("solc-{version}")); + let output = Command::new(solc_path) .arg("--version") .stdin(Stdio::piped()) .stderr(Stdio::piped()) @@ -493,7 +490,7 @@ mod tests { // ensures we can download the latest native solc for apple silicon #[tokio::test(flavor = "multi_thread")] async fn can_download_latest_native_apple_silicon() { - let latest: Version = "0.8.15".parse().unwrap(); + let latest: Version = "0.8.18".parse().unwrap(); let artifacts = all_releases(Platform::MacOsAarch64).await.unwrap(); diff --git a/src/platform.rs b/src/platform.rs index 40b379a..a9b3a9c 100644 --- a/src/platform.rs +++ b/src/platform.rs @@ -37,7 +37,7 @@ impl FromStr for Platform { "macosx-amd64" => Ok(Platform::MacOsAmd64), "macosx-aarch64" => Ok(Platform::MacOsAarch64), "windows-amd64" => Ok(Platform::WindowsAmd64), - s => Err(format!("unsupported platform {}", s)), + s => Err(format!("unsupported platform {s}")), } } } diff --git a/src/releases.rs b/src/releases.rs index 95c6326..a23e89a 100644 --- a/src/releases.rs +++ b/src/releases.rs @@ -25,7 +25,7 @@ static OLD_SOLC_RELEASES: Lazy = Lazy::new(|| { }); static LINUX_AARCH64_URL_PREFIX: &str = - "https://github.com/nikitastupin/solc/raw/bd9079b31dd4cb06a98cd3c76b3c3d3ab956de5e/linux/aarch64"; + "https://github.com/nikitastupin/solc/raw/01a11efffb8111db0637d4b47a8360bb66979d82/linux/aarch64"; static LINUX_AARCH64_RELEASES: Lazy = Lazy::new(|| { serde_json::from_str(include_str!("../list/linux-aarch64.json")) @@ -35,10 +35,10 @@ static LINUX_AARCH64_RELEASES: Lazy = Lazy::new(|| { static MACOS_AARCH64_NATIVE: Lazy = Lazy::new(|| Version::new(0, 8, 5)); static MACOS_AARCH64_URL_PREFIX: &str = - "https://github.com/roynalnaruto/solc-builds/raw/ff4ea8a7bbde4488428de69f2c40a7fc56184f5e/macosx/aarch64"; + "https://github.com/roynalnaruto/solc-builds/raw/33fe42fdb907265ea6f543d1eba18ffe9a05fa6f/macosx/aarch64"; static MACOS_AARCH64_RELEASES_URL: &str = - "https://github.com/roynalnaruto/solc-builds/raw/ff4ea8a7bbde4488428de69f2c40a7fc56184f5e/macosx/aarch64/list.json"; + "https://github.com/roynalnaruto/solc-builds/raw/33fe42fdb907265ea6f543d1eba18ffe9a05fa6f/macosx/aarch64/list.json"; /// Defines the struct that the JSON-formatted release list can be deserialized into. /// @@ -148,7 +148,7 @@ pub fn blocking_all_releases(platform: Platform) -> Result()?; Ok(unified_releases(releases, platform)) } @@ -189,7 +189,7 @@ pub async fn all_releases(platform: Platform) -> Result { return Ok(releases); } - let releases = get(format!("{}/{}/list.json", SOLC_RELEASES_URL, platform)) + let releases = get(format!("{SOLC_RELEASES_URL}/{platform}/list.json")) .await? .json::() .await?; @@ -220,16 +220,14 @@ pub fn artifact_url( && version.ge(&OLD_VERSION_MIN) { return Ok(Url::parse(&format!( - "{}/{}", - OLD_SOLC_RELEASES_DOWNLOAD_PREFIX, artifact + "{OLD_SOLC_RELEASES_DOWNLOAD_PREFIX}/{artifact}" ))?); } if platform == Platform::LinuxAarch64 { if LINUX_AARCH64_RELEASES.releases.contains_key(version) { return Ok(Url::parse(&format!( - "{}/{}", - LINUX_AARCH64_URL_PREFIX, artifact + "{LINUX_AARCH64_URL_PREFIX}/{artifact}" ))?); } else { return Err(SolcVmError::UnsupportedVersion( @@ -249,8 +247,7 @@ pub fn artifact_url( if platform == Platform::MacOsAarch64 { if version.ge(&MACOS_AARCH64_NATIVE) { return Ok(Url::parse(&format!( - "{}/{}", - MACOS_AARCH64_URL_PREFIX, artifact + "{MACOS_AARCH64_URL_PREFIX}/{artifact}" ))?); } else { return Ok(Url::parse(&format!( @@ -263,8 +260,7 @@ pub fn artifact_url( } Ok(Url::parse(&format!( - "{}/{}/{}", - SOLC_RELEASES_URL, platform, artifact + "{SOLC_RELEASES_URL}/{platform}/{artifact}" ))?) } @@ -280,8 +276,8 @@ mod tests { #[test] fn test_linux_aarch64() { - assert_eq!(LINUX_AARCH64_RELEASES.releases.len(), 49); - assert_eq!(LINUX_AARCH64_RELEASES.builds.len(), 49); + assert_eq!(LINUX_AARCH64_RELEASES.releases.len(), 50); + assert_eq!(LINUX_AARCH64_RELEASES.builds.len(), 50); } #[tokio::test] diff --git a/src/svm/main.rs b/src/svm/main.rs index 3fb533a..7f27058 100644 --- a/src/svm/main.rs +++ b/src/svm/main.rs @@ -76,7 +76,7 @@ async fn handle_install(version: Version) -> anyhow::Result<()> { let current_version = svm_lib::current_version()?; if installed_versions.contains(&version) { - println!("Solc {} is already installed", version); + println!("Solc {version} is already installed"); let input: String = Input::new() .with_prompt("Would you like to set it as the global version?") .with_initial_text("Y") @@ -89,7 +89,7 @@ async fn handle_install(version: Version) -> anyhow::Result<()> { } else if all_versions.contains(&version) { let spinner = print::installing_version(&version); svm_lib::install(&version).await?; - spinner.finish_with_message(format!("Downloaded Solc: {}", version)); + spinner.finish_with_message(format!("Downloaded Solc: {version}")); if current_version.is_none() { svm_lib::use_version(&version)?; print::set_global_version(&version); @@ -109,7 +109,7 @@ async fn handle_use(version: Version) -> anyhow::Result<()> { svm_lib::use_version(&version)?; print::set_global_version(&version); } else if all_versions.contains(&version) { - println!("Solc {} is not installed", version); + println!("Solc {version} is not installed"); let input: String = Input::new() .with_prompt("Would you like to install it?") .with_initial_text("Y") diff --git a/src/svm/print.rs b/src/svm/print.rs index 5ccbd94..a1cd4c2 100644 --- a/src/svm/print.rs +++ b/src/svm/print.rs @@ -40,7 +40,7 @@ pub fn available_versions(versions: Vec) { pub fn installing_version(version: &Version) -> ProgressBar { let spinner = ProgressBar::new_spinner(); spinner.enable_steady_tick(120); - spinner.set_message(format!("Downloading Solc {}", version)); + spinner.set_message(format!("Downloading Solc {version}")); spinner.set_style( ProgressStyle::default_spinner() .tick_strings(&[ @@ -53,16 +53,13 @@ pub fn installing_version(version: &Version) -> ProgressBar { } pub fn unsupported_version(version: &Version) { - println!( - "{}", - style(format!("Version: {} unsupported", version)).red() - ); + println!("{}", style(format!("Version: {version} unsupported")).red()); } pub fn set_global_version(version: &Version) { - ProgressBar::new_spinner().finish_with_message(format!("Global version set: {}", version)); + ProgressBar::new_spinner().finish_with_message(format!("Global version set: {version}")); } pub fn version_not_found(version: &Version) { - println!("{}", style(format!("Version: {} not found", version)).red()); + println!("{}", style(format!("Version: {version} not found")).red()); } diff --git a/svm-builds/Cargo.toml b/svm-builds/Cargo.toml index 1798126..170da5e 100644 --- a/svm-builds/Cargo.toml +++ b/svm-builds/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "svm-rs-builds" -version = "0.1.11" +version = "0.1.12" edition = "2021" authors = ["Matthias Seitz ", "Rohit Narurkar "] license = "MIT OR Apache-2.0" @@ -14,7 +14,7 @@ build = "build.rs" [build-dependencies] build_const = "0.2.2" -svm = { package = "svm-rs", version = "0.2.19", path = "..", features = ["blocking"]} +svm = { package = "svm-rs", version = "0.2.20", path = "..", features = ["blocking"]} semver = { version = "1.0.4", default-features = false, features = ["std", "serde"] } hex = "0.4.3" serde_json = "1.0.79"