diff --git a/saphyr/examples/dump_yaml.rs b/saphyr/examples/dump_yaml.rs index a77d676..5f2e306 100644 --- a/saphyr/examples/dump_yaml.rs +++ b/saphyr/examples/dump_yaml.rs @@ -12,13 +12,13 @@ fn print_indent(indent: usize) { } fn dump_node(doc: &yaml::Yaml, indent: usize) { - match doc { - &yaml::Yaml::Array(ref v) => { + match *doc { + yaml::Yaml::Array(ref v) => { for x in v { dump_node(x, indent + 1); } }, - &yaml::Yaml::Hash(ref h) => { + yaml::Yaml::Hash(ref h) => { for (k, v) in h { print_indent(indent); println!("{:?}:", k); diff --git a/saphyr/src/emitter.rs b/saphyr/src/emitter.rs index 3ea2f2d..7d2ec0a 100644 --- a/saphyr/src/emitter.rs +++ b/saphyr/src/emitter.rs @@ -1,6 +1,6 @@ use std::fmt; use std::convert::From; -use yaml::{Array, Hash, Yaml}; +use yaml::{Hash, Yaml}; #[derive(Copy, Clone, Debug)] pub enum EmitError { @@ -193,7 +193,7 @@ impl<'a> YamlEmitter<'a> { } } - fn emit_array(&mut self, v: &Array) -> EmitResult { + fn emit_array(&mut self, v: &[Yaml]) -> EmitResult { if v.is_empty() { try!(write!(self.writer, "[]")); } else { diff --git a/saphyr/tests/quickcheck.rs b/saphyr/tests/quickcheck.rs index 62db056..54be25d 100644 --- a/saphyr/tests/quickcheck.rs +++ b/saphyr/tests/quickcheck.rs @@ -11,11 +11,11 @@ quickcheck! { let mut out_str = String::new(); { let mut emitter = YamlEmitter::new(&mut out_str); - emitter.dump(&Yaml::Array(xs.into_iter().map(|s| Yaml::String(s)).collect())).unwrap(); + emitter.dump(&Yaml::Array(xs.into_iter().map(Yaml::String).collect())).unwrap(); } if let Err(err) = YamlLoader::load_from_str(&out_str) { return TestResult::error(err.description()); } - return TestResult::passed(); + TestResult::passed() } -} \ No newline at end of file +} diff --git a/saphyr/tests/spec_test.rs b/saphyr/tests/spec_test.rs index a79c051..b7316fc 100644 --- a/saphyr/tests/spec_test.rs +++ b/saphyr/tests/spec_test.rs @@ -5,6 +5,8 @@ extern crate yaml_rust; use yaml_rust::parser::{Parser, EventReceiver, Event}; use yaml_rust::scanner::TScalarStyle; +// These names match the names used in the C++ test suite. +#[cfg_attr(feature = "cargo-clippy", allow(enum_variant_names))] #[derive(Clone, PartialEq, PartialOrd, Debug)] enum TestEvent { OnDocumentStart,