Skip to content

Commit

Permalink
deps: remove yaml-rust in favor of serde-yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
wez committed May 5, 2024
1 parent cab8523 commit c4021d2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 34 deletions.
17 changes: 1 addition & 16 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion sync-color-schemes/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
19 changes: 2 additions & 17 deletions sync-color-schemes/src/base16.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>> {
Expand Down

0 comments on commit c4021d2

Please sign in to comment.