diff --git a/exercises/practice/dot-dsl/Cargo.toml b/exercises/practice/dot-dsl/Cargo.toml index 81acbd4b2..9361866ea 100644 --- a/exercises/practice/dot-dsl/Cargo.toml +++ b/exercises/practice/dot-dsl/Cargo.toml @@ -3,5 +3,5 @@ edition = "2021" name = "dot-dsl" version = "0.1.0" -[dependencies] -maplit = "1.0.1" +[lints.clippy] +new_without_default = "allow" diff --git a/exercises/practice/dot-dsl/tests/dot-dsl.rs b/exercises/practice/dot-dsl/tests/dot-dsl.rs index 9bf673a87..54bd34958 100644 --- a/exercises/practice/dot-dsl/tests/dot-dsl.rs +++ b/exercises/practice/dot-dsl/tests/dot-dsl.rs @@ -1,7 +1,8 @@ +use std::collections::HashMap; + use dot_dsl::graph::graph_items::edge::Edge; use dot_dsl::graph::graph_items::node::Node; use dot_dsl::graph::Graph; -use maplit::hashmap; #[test] fn empty_graph() { @@ -81,9 +82,7 @@ fn graph_with_one_edge_with_keywords() { fn graph_with_one_attribute() { let graph = Graph::new().with_attrs(&[("foo", "1")]); - let expected_attrs = hashmap! { - "foo".to_string() => "1".to_string(), - }; + let expected_attrs = HashMap::from([("foo".to_string(), "1".to_string())]); assert!(graph.nodes.is_empty()); @@ -108,11 +107,11 @@ fn graph_with_attributes() { let attrs = vec![("foo", "1"), ("title", "Testing Attrs"), ("bar", "true")]; - let expected_attrs = hashmap! { - "foo".to_string() => "1".to_string(), - "title".to_string() => "Testing Attrs".to_string(), - "bar".to_string() => "true".to_string(), - }; + let expected_attrs = HashMap::from([ + ("foo".to_string(), "1".to_string()), + ("title".to_string(), "Testing Attrs".to_string()), + ("bar".to_string(), "true".to_string()), + ]); let graph = Graph::new() .with_nodes(&nodes)