1
1
mirror of https://github.com/wez/wezterm.git synced 2024-08-17 10:10:23 +03:00

deps: remove yaml-rust in favor of serde-yaml

This commit is contained in:
Wez Furlong 2024-05-04 17:05:12 -07:00
parent cab8523f85
commit c4021d2109
No known key found for this signature in database
GPG Key ID: 7A7F66A31EC9B387
3 changed files with 4 additions and 34 deletions

17
Cargo.lock generated
View File

@ -2965,12 +2965,6 @@ dependencies = [
"num-traits",
]
[[package]]
name = "linked-hash-map"
version = "0.5.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f"
[[package]]
name = "linux-raw-sys"
version = "0.3.8"
@ -5167,13 +5161,13 @@ dependencies = [
"rusqlite",
"serde",
"serde_json",
"serde_yaml",
"sqlite-cache",
"tar",
"tempfile",
"tokio",
"toml 0.8.12",
"wezterm-dynamic",
"yaml-rust",
]
[[package]]
@ -7194,15 +7188,6 @@ version = "0.8.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "791978798f0597cfc70478424c2b4fdc2b7a8024aaff78497ef00f24ef674193"
[[package]]
name = "yaml-rust"
version = "0.4.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85"
dependencies = [
"linked-hash-map",
]
[[package]]
name = "yasna"
version = "0.5.2"

View File

@ -18,10 +18,10 @@ reqwest = "0.11"
rusqlite = {version="0.30", features=["bundled", "blob"]}
serde = {version="1.0", features=["derive"]}
serde_json = "1.0"
serde_yaml = "0.9"
sqlite-cache = {git="https://github.com/losfair/sqlite-cache", rev="0961b50385ff189bb12742716331c05ed0bf7805" }
tar = "0.4"
tempfile = "3.3"
tokio = { version = "1.19", features = ["rt-multi-thread", "sync", "macros"] }
toml = "0.8"
wezterm-dynamic = { path = "../wezterm-dynamic" }
yaml-rust = "0.4.5"

View File

@ -11,23 +11,8 @@ async fn fetch_base16_list() -> anyhow::Result<Vec<String>> {
)
.await?;
let mut result = vec![];
for doc in yaml_rust::YamlLoader::load_from_str(&data)? {
for value in doc
.into_hash()
.ok_or_else(|| anyhow::anyhow!("list.yaml isn't a hash"))?
.values()
{
result.push(
value
.clone()
.into_string()
.ok_or_else(|| anyhow::anyhow!("item {value:?} is not a string"))?,
);
}
}
Ok(result)
let mapping: HashMap<String, String> = serde_yaml::from_str(&data)?;
Ok(mapping.into_values().collect())
}
async fn fetch_repo_tarball(repo_url: &str, branch: &str) -> anyhow::Result<Vec<u8>> {