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

Migrated from yaml-rust to its well-maintaned fork #461

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
169 changes: 17 additions & 152 deletions Cargo.lock.msrv

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ globset = { version = "0.4.6", optional = true }
walkdir = { version = "2.3.1", optional = true }
similar = { version = "2.1.0", features = ["inline"] }
regex = { version = "1.6.0", default-features = false, optional = true, features = ["std", "unicode"] }
yaml-rust = "0.4.5"
yaml-rust2 = "0.5.0"
serde = { version = "1.0.117", optional = true }
linked-hash-map = "0.5.6"
lazy_static = "1.4.0"
Expand Down
6 changes: 3 additions & 3 deletions src/content/yaml.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ use std::path::Path;

use crate::content::{Content, Error};

use yaml_rust::{yaml::Hash as YamlObj, Yaml as YamlValue};
use yaml_rust2::{yaml::Hash as YamlObj, Yaml as YamlValue};

pub fn parse_str(s: &str, filename: &Path) -> Result<Content, Error> {
let mut blobs = yaml_rust::YamlLoader::load_from_str(s)
let mut blobs = yaml_rust2::YamlLoader::load_from_str(s)
.map_err(|_| Error::FailedParsingYaml(filename.to_path_buf()))?;

match (blobs.pop(), blobs.pop()) {
Expand Down Expand Up @@ -48,7 +48,7 @@ pub fn to_string(content: &Content) -> String {
let yaml_blob = to_yaml_value(content);

let mut buf = String::new();
let mut emitter = yaml_rust::YamlEmitter::new(&mut buf);
let mut emitter = yaml_rust2::YamlEmitter::new(&mut buf);
emitter.dump(&yaml_blob).unwrap();

if !buf.ends_with('\n') {
Expand Down
2 changes: 1 addition & 1 deletion src/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ pub fn get_cargo_workspace(manifest_dir: &str) -> Arc<PathBuf> {
.output()
.unwrap();
let docs =
yaml_rust::YamlLoader::load_from_str(std::str::from_utf8(&output.stdout).unwrap())
yaml_rust2::YamlLoader::load_from_str(std::str::from_utf8(&output.stdout).unwrap())
.unwrap();
let manifest = docs.first().expect("Unable to parse cargo manifest");
let workspace_root = PathBuf::from(manifest["workspace_root"].as_str().unwrap());
Expand Down
Loading