Skip to content

Commit 72ed949

Browse files
authored
dot-dsl: allow owned and borrowed strings (#2010)
forum discussion: https://forum.exercism.org/t/unnecessary-to-string-calls-in-the-test-file-of-dot-dsl/15525 [no important files changed]
1 parent e4824c3 commit 72ed949

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Diff for: exercises/practice/dot-dsl/tests/dot-dsl.rs

+6-4
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ fn graph_with_one_edge_with_keywords() {
8282
fn graph_with_one_attribute() {
8383
let graph = Graph::new().with_attrs(&[("foo", "1")]);
8484

85-
let expected_attrs = HashMap::from([("foo".to_string(), "1".to_string())]);
85+
#[allow(clippy::useless_conversion, reason = "allow String and &str")]
86+
let expected_attrs = HashMap::from([("foo".into(), "1".into())]);
8687

8788
assert!(graph.nodes.is_empty());
8889

@@ -107,10 +108,11 @@ fn graph_with_attributes() {
107108

108109
let attrs = vec![("foo", "1"), ("title", "Testing Attrs"), ("bar", "true")];
109110

111+
#[allow(clippy::useless_conversion, reason = "allow String and &str")]
110112
let expected_attrs = HashMap::from([
111-
("foo".to_string(), "1".to_string()),
112-
("title".to_string(), "Testing Attrs".to_string()),
113-
("bar".to_string(), "true".to_string()),
113+
("foo".into(), "1".into()),
114+
("title".into(), "Testing Attrs".into()),
115+
("bar".into(), "true".into()),
114116
]);
115117

116118
let graph = Graph::new()

0 commit comments

Comments
 (0)