diff --git a/Cargo.lock b/Cargo.lock index abe28a3b..bbe839ee 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -257,7 +257,7 @@ dependencies = [ "binstalk-types", "cargo-toml-workspace", "command-group", - "compact_str 0.7.1", + "compact_str", "detect-targets", "either", "itertools", @@ -283,7 +283,7 @@ version = "0.4.0" dependencies = [ "atomic-file-install", "binstalk-types", - "compact_str 0.7.1", + "compact_str", "leon", "miette", "normalize-path", @@ -302,7 +302,7 @@ dependencies = [ "binstall-tar", "bytes", "bzip2", - "compact_str 0.7.1", + "compact_str", "default-net", "flate2", "futures-io", @@ -334,7 +334,7 @@ dependencies = [ "binstalk-git-repo-api", "binstalk-types", "bytes", - "compact_str 0.7.1", + "compact_str", "either", "itertools", "leon", @@ -354,7 +354,7 @@ name = "binstalk-git-repo-api" version = "0.3.0" dependencies = [ "binstalk-downloader", - "compact_str 0.7.1", + "compact_str", "once_cell", "percent-encoding", "serde", @@ -374,7 +374,7 @@ version = "0.13.0" dependencies = [ "beef", "binstalk-types", - "compact_str 0.7.1", + "compact_str", "detect-targets", "fs-lock", "home", @@ -398,7 +398,7 @@ dependencies = [ "binstalk-downloader", "binstalk-types", "cargo-toml-workspace", - "compact_str 0.7.1", + "compact_str", "leon", "miette", "normalize-path", @@ -420,7 +420,7 @@ dependencies = [ name = "binstalk-types" version = "0.7.0" dependencies = [ - "compact_str 0.7.1", + "compact_str", "maybe-owned", "once_cell", "semver", @@ -555,7 +555,7 @@ dependencies = [ "binstalk", "binstalk-manifests", "clap", - "compact_str 0.7.1", + "compact_str", "dirs", "embed-resource", "file-format", @@ -592,7 +592,7 @@ name = "cargo-toml-workspace" version = "6.0.0" dependencies = [ "cargo_toml", - "compact_str 0.7.1", + "compact_str", "glob", "normalize-path", "serde", @@ -724,20 +724,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "compact_str" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f86b9c4c00838774a6d902ef931eff7470720c51d90c2e32cfe15dc304737b3f" -dependencies = [ - "castaway", - "cfg-if", - "itoa", - "ryu", - "serde", - "static_assertions", -] - [[package]] name = "compact_str" version = "0.8.0" @@ -749,6 +735,7 @@ dependencies = [ "itoa", "rustversion", "ryu", + "serde", "static_assertions", ] @@ -3735,7 +3722,7 @@ version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "48955a621e2b4a92fdb9fcbf8a5bf0e56b15a56bfe09e6defc01cb25ca59f31c" dependencies = [ - "compact_str 0.8.0", + "compact_str", "derive_destructure2", "gix", "thiserror", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index e0099d56..42529cb8 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -25,7 +25,7 @@ pkg-fmt = "zip" binstalk = { path = "../binstalk", version = "0.26.1", default-features = false } binstalk-manifests = { path = "../binstalk-manifests", version = "0.13.0" } clap = { version = "4.5.3", features = ["derive", "env"] } -compact_str = "0.7.0" +compact_str = "0.8.0" dirs = "5.0.1" file-format = { version = "0.25.0", default-features = false } home = "0.5.9" diff --git a/crates/binstalk-bins/Cargo.toml b/crates/binstalk-bins/Cargo.toml index a7f88aae..5a9b3983 100644 --- a/crates/binstalk-bins/Cargo.toml +++ b/crates/binstalk-bins/Cargo.toml @@ -13,7 +13,7 @@ license = "GPL-3.0-only" [dependencies] atomic-file-install = { version = "1.0.5", path = "../atomic-file-install" } binstalk-types = { version = "0.7.0", path = "../binstalk-types" } -compact_str = { version = "0.7.0", features = ["serde"] } +compact_str = { version = "0.8.0", features = ["serde"] } leon = "3.0.0" miette = "7.0.0" normalize-path = { version = "0.2.1", path = "../normalize-path" } diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 47a919c2..f95505f4 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -30,7 +30,7 @@ async_zip = { version = "0.0.17", features = [ binstalk-types = { version = "0.7.0", path = "../binstalk-types" } bytes = "1.4.0" bzip2 = "0.4.4" -compact_str = "0.7.0" +compact_str = "0.8.0" flate2 = { version = "1.0.28", default-features = false } futures-util = "0.3.30" futures-io = "0.3.30" diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index 2e074a0c..3c1f1458 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -16,7 +16,7 @@ binstalk-downloader = { version = "0.11.5", path = "../binstalk-downloader", def binstalk-git-repo-api = { version = "0.3.0", path = "../binstalk-git-repo-api" } binstalk-types = { version = "0.7.0", path = "../binstalk-types" } bytes = "1.4.0" -compact_str = { version = "0.7.0" } +compact_str = { version = "0.8.0" } either = "1.11.0" itertools = "0.13.0" leon = "3.0.0" diff --git a/crates/binstalk-git-repo-api/Cargo.toml b/crates/binstalk-git-repo-api/Cargo.toml index 5f450329..0810f549 100644 --- a/crates/binstalk-git-repo-api/Cargo.toml +++ b/crates/binstalk-git-repo-api/Cargo.toml @@ -13,7 +13,7 @@ license = "Apache-2.0 OR MIT" binstalk-downloader = { version = "0.11.5", path = "../binstalk-downloader", default-features = false, features = [ "json", ] } -compact_str = "0.7.0" +compact_str = "0.8.0" percent-encoding = "2.2.0" serde = { version = "1.0.163", features = ["derive"] } serde-tuple-vec-map = "1.0.1" diff --git a/crates/binstalk-git-repo-api/src/gh_api_client.rs b/crates/binstalk-git-repo-api/src/gh_api_client.rs index 5b6420cf..8773fa11 100644 --- a/crates/binstalk-git-repo-api/src/gh_api_client.rs +++ b/crates/binstalk-git-repo-api/src/gh_api_client.rs @@ -338,10 +338,10 @@ mod test { pub(super) const RELEASE: GhRelease = GhRelease { repo: GhRepo { - owner: CompactString::new_inline("cargo-bins"), - repo: CompactString::new_inline("cargo-binstall"), + owner: CompactString::const_new("cargo-bins"), + repo: CompactString::const_new("cargo-binstall"), }, - tag: CompactString::new_inline("v0.20.1"), + tag: CompactString::const_new("v0.20.1"), }; pub(super) const ARTIFACTS: &[&str] = &[ @@ -375,10 +375,10 @@ mod test { pub(super) const RELEASE: GhRelease = GhRelease { repo: GhRepo { - owner: CompactString::new_inline("rustsec"), - repo: CompactString::new_inline("rustsec"), + owner: CompactString::const_new("rustsec"), + repo: CompactString::const_new("rustsec"), }, - tag: CompactString::new_inline("cargo-audit/v0.17.6"), + tag: CompactString::const_new("cargo-audit/v0.17.6"), }; #[allow(unused)] @@ -417,7 +417,7 @@ mod test { ] .into_iter() .for_each(|url| { - let url = Url::parse(&url).unwrap(); + let url = Url::parse(url).unwrap(); assert_eq!( GhRepo::try_extract_from_url(&url) .unwrap() @@ -545,16 +545,16 @@ mod test { #[tokio::test] async fn rate_limited_test_get_repo_info() { const PUBLIC_REPOS: [GhRepo; 1] = [GhRepo { - owner: CompactString::new_inline("cargo-bins"), - repo: CompactString::new_inline("cargo-binstall"), + owner: CompactString::const_new("cargo-bins"), + repo: CompactString::const_new("cargo-binstall"), }]; const PRIVATE_REPOS: [GhRepo; 1] = [GhRepo { - owner: CompactString::new_inline("cargo-bins"), - repo: CompactString::new_inline("private-repo-for-testing"), + owner: CompactString::const_new("cargo-bins"), + repo: CompactString::const_new("private-repo-for-testing"), }]; const NON_EXISTENT_REPOS: [GhRepo; 1] = [GhRepo { - owner: CompactString::new_inline("cargo-bins"), - repo: CompactString::new_inline("ttt"), + owner: CompactString::const_new("cargo-bins"), + repo: CompactString::const_new("ttt"), }]; init_logger(); @@ -610,12 +610,12 @@ mod test { )]; const NON_EXISTENT_RELEASES: [GhRelease; 1] = [GhRelease { repo: GhRepo { - owner: CompactString::new_inline("cargo-bins"), - repo: CompactString::new_inline("cargo-binstall"), + owner: CompactString::const_new("cargo-bins"), + repo: CompactString::const_new("cargo-binstall"), }, // We are currently at v0.20.1 and we would never release // anything older than v0.20.1 - tag: CompactString::new_inline("v0.18.2"), + tag: CompactString::const_new("v0.18.2"), }]; init_logger(); diff --git a/crates/binstalk-git-repo-api/src/gh_api_client/error.rs b/crates/binstalk-git-repo-api/src/gh_api_client/error.rs index 1787a372..0a2918a9 100644 --- a/crates/binstalk-git-repo-api/src/gh_api_client/error.rs +++ b/crates/binstalk-git-repo-api/src/gh_api_client/error.rs @@ -197,7 +197,7 @@ mod test { assert_matches!(deserialize("RATE_LIMITED"), GraphQLErrorType::RateLimited); assert_matches!( deserialize("rATE_LIMITED"), - GraphQLErrorType::Other(val) if val == CompactString::new("rATE_LIMITED") + GraphQLErrorType::Other(val) if val == CompactString::const_new("rATE_LIMITED") ); } } diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index b66070ea..151829e3 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -12,7 +12,7 @@ license = "Apache-2.0 OR MIT" [dependencies] beef = { version = "0.5.2", features = ["impl_serde"] } binstalk-types = { version = "0.7.0", path = "../binstalk-types" } -compact_str = { version = "0.7.0", features = ["serde"] } +compact_str = { version = "0.8.0", features = ["serde"] } fs-lock = { version = "0.1.3", path = "../fs-lock" } home = "0.5.9" miette = "7.0.0" diff --git a/crates/binstalk-manifests/src/cargo_config.rs b/crates/binstalk-manifests/src/cargo_config.rs index 21fac013..a92cc104 100644 --- a/crates/binstalk-manifests/src/cargo_config.rs +++ b/crates/binstalk-manifests/src/cargo_config.rs @@ -210,7 +210,7 @@ root = "/some/path" # `cargo install` destination directory ); let http = config.http.unwrap(); - assert_eq!(http.proxy.unwrap(), CompactString::new_inline("host:port")); + assert_eq!(http.proxy.unwrap(), CompactString::const_new("host:port")); assert_eq!(http.timeout.unwrap(), 30); assert_eq!(http.cainfo.unwrap(), Path::new("root").join("cert.pem")); @@ -218,7 +218,7 @@ root = "/some/path" # `cargo install` destination directory assert_eq!(env.len(), 3); assert_eq!( env.get("ENV_VAR_NAME").unwrap(), - &Env::Value(CompactString::new("value")) + &Env::Value(CompactString::const_new("value")) ); assert_eq!( env.get("ENV_VAR_NAME_2").unwrap(), diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index 727e3c5e..940b48db 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -18,7 +18,7 @@ binstalk-downloader = { version = "0.11.5", path = "../binstalk-downloader", def ] } binstalk-types = { version = "0.7.0", path = "../binstalk-types" } cargo-toml-workspace = { version = "6.0.0", path = "../cargo-toml-workspace" } -compact_str = { version = "0.7.0", features = ["serde"] } +compact_str = { version = "0.8.0", features = ["serde"] } leon = "3.0.0" miette = "7.0.0" normalize-path = { version = "0.2.1", path = "../normalize-path" } diff --git a/crates/binstalk-registry/src/common.rs b/crates/binstalk-registry/src/common.rs index 17f5fefa..cd426298 100644 --- a/crates/binstalk-registry/src/common.rs +++ b/crates/binstalk-registry/src/common.rs @@ -96,10 +96,10 @@ pub(super) fn crate_prefix_components( match (chars.next(), chars.next(), chars.next(), chars.next()) { (None, None, None, None) => Err(RegistryError::NotFound(crate_name.into())), - (Some(_), None, None, None) => Ok((CompactString::new("1"), None)), - (Some(_), Some(_), None, None) => Ok((CompactString::new("2"), None)), + (Some(_), None, None, None) => Ok((CompactString::const_new("1"), None)), + (Some(_), Some(_), None, None) => Ok((CompactString::const_new("2"), None)), (Some(ch), Some(_), Some(_), None) => Ok(( - CompactString::new("3"), + CompactString::const_new("3"), Some(ch.to_lowercase().to_compact_string()), )), (Some(a), Some(b), Some(c), Some(d)) => Ok(( @@ -127,7 +127,7 @@ pub(super) fn render_dl_template( struct Context<'a> { crate_name: &'a str, crate_prefix: CompactString, - crate_lowerprefix: String, + crate_lowerprefix: CompactString, version: &'a str, cksum: &'a str, } diff --git a/crates/binstalk-types/Cargo.toml b/crates/binstalk-types/Cargo.toml index 4d7ed95e..8560eb7c 100644 --- a/crates/binstalk-types/Cargo.toml +++ b/crates/binstalk-types/Cargo.toml @@ -10,7 +10,7 @@ edition = "2021" license = "Apache-2.0 OR MIT" [dependencies] -compact_str = { version = "0.7.0", features = ["serde"] } +compact_str = { version = "0.8.0", features = ["serde"] } maybe-owned = { version = "0.3.4", features = ["serde"] } once_cell = "1.18.0" semver = { version = "1.0.17", features = ["serde"] } diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 8d6a291c..f067de70 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -20,7 +20,7 @@ binstalk-registry = { version = "0.9.1", path = "../binstalk-registry" } binstalk-types = { version = "0.7.0", path = "../binstalk-types" } cargo-toml-workspace = { version = "6.0.0", path = "../cargo-toml-workspace" } command-group = { version = "5.0.1", features = ["with-tokio"] } -compact_str = { version = "0.7.0", features = ["serde"] } +compact_str = { version = "0.8.0", features = ["serde"] } detect-targets = { version = "0.1.17", path = "../detect-targets", features = [ "tracing", ] } diff --git a/crates/cargo-toml-workspace/Cargo.toml b/crates/cargo-toml-workspace/Cargo.toml index 6c6fca80..f1f5157d 100644 --- a/crates/cargo-toml-workspace/Cargo.toml +++ b/crates/cargo-toml-workspace/Cargo.toml @@ -11,7 +11,7 @@ license = "Apache-2.0 OR MIT" [dependencies] cargo_toml = "0.20.0" -compact_str = { version = "0.7.0", features = ["serde"] } +compact_str = { version = "0.8.0", features = ["serde"] } glob = "0.3.1" normalize-path = { version = "0.2.1", path = "../normalize-path" } serde = "1.0.163"