From 733c2024173302a614e31544e54c1c5b26b15f5c Mon Sep 17 00:00:00 2001 From: Paul Hauner Date: Wed, 22 May 2019 18:55:11 +1000 Subject: [PATCH] Remove unused functions from `ef_tests` --- tests/ef_tests/src/yaml_decode/utils.rs | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/tests/ef_tests/src/yaml_decode/utils.rs b/tests/ef_tests/src/yaml_decode/utils.rs index 9b7d7ef53..059d3b5d2 100644 --- a/tests/ef_tests/src/yaml_decode/utils.rs +++ b/tests/ef_tests/src/yaml_decode/utils.rs @@ -1,28 +1,3 @@ -use yaml_rust::{Yaml, YamlEmitter, YamlLoader}; - -pub fn extract_yaml_by_key(yaml: &str, key: &str) -> String { - let doc = &YamlLoader::load_from_str(yaml).unwrap()[0]; - let subsection = &doc[key]; - - yaml_to_string(subsection) -} - -pub fn extract_yaml_by_index(yaml: &str, index: usize) -> String { - let doc = &YamlLoader::load_from_str(yaml).unwrap()[0]; - let subsection = &doc[index]; - - yaml_to_string(subsection) -} - -pub fn yaml_to_string(yaml: &Yaml) -> String { - let mut out_str = String::new(); - let mut emitter = YamlEmitter::new(&mut out_str); - emitter.escape_all_strings(true); - emitter.dump(yaml).unwrap(); - - out_str -} - pub fn yaml_split_header_and_cases(mut yaml: String) -> (String, String) { let test_cases_start = yaml.find("\ntest_cases:\n").unwrap(); // + 1 to skip the \n we used for matching.