Skip to content

Commit

Permalink
test failing?
Browse files Browse the repository at this point in the history
  • Loading branch information
cristianoliveira committed Mar 29, 2024
1 parent e2d344e commit cd396f3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/rules.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,20 @@ pub fn template(commands: Vec<String>, filepath: &str) -> Vec<String> {
}

pub fn from_yaml(file_content: &str) -> Result<Vec<Rules>, String> {
println!("@@@@@@@@@ filecontent {:?}", file_content);
let items = match YamlLoader::load_from_str(file_content) {
Ok(val) => val,
Err(err) => {
println!("@@@@@@@@@ err {:?}", err);
return Err(format!(
"Found an invalid yaml format {}",
err
));
}
};

println!("@@@@@@@@@ items {:?}", items);

match items[0] {
Yaml::Array(ref items) => Ok(items.iter().map(Rules::from).collect()),
_ => Err("You must have at last one item in the yaml.".to_owned()),
Expand Down

0 comments on commit cd396f3

Please sign in to comment.