Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract deserialize_yml to axoasset #1440

Closed
mistydemeo opened this issue Oct 3, 2024 · 2 comments · Fixed by #1604
Closed

Extract deserialize_yml to axoasset #1440

mistydemeo opened this issue Oct 3, 2024 · 2 comments · Fixed by #1604
Labels
good first issue Good for newcomers

Comments

@mistydemeo
Copy link
Contributor

mistydemeo commented Oct 3, 2024

We have a function in cargo-dist that's essentially a copy of axoasset's deserialize_toml and deserialize_json, but for YAML:

/// Try to deserialize the contents of the SourceFile as yaml
///
/// FIXME: upstream to axoasset
fn deserialize_yaml<'a, T: for<'de> serde::Deserialize<'de>>(
src: &'a SourceFile,
) -> Result<T, crate::errors::AxoassetYamlError> {
let yaml = serde_yml::from_str(src.contents()).map_err(|details| {
let span = details
.location()
.and_then(|location| src.span_for_line_col(location.line(), location.column()));
crate::errors::AxoassetYamlError {
source: src.clone(),
span,
details,
}
})?;
Ok(yaml)
}

It would be great for us to extract it from cargo-dist and get it into axoasset.

@mistydemeo mistydemeo added the good first issue Good for newcomers label Oct 3, 2024
@duckinator
Copy link
Contributor

The first half of this (adding the implementation to axoasset) is here: axodotdev/axoasset#235

@duckinator
Copy link
Contributor

The second half is #1604.

@duckinator duckinator linked a pull request Dec 4, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants