Skip to content

Commit 82de179

Browse files
author
spicychickensauce
committed
Remove unnecessary flat_map
1 parent 9062d95 commit 82de179

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/lazy_html_test.exs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ defmodule LazyHTMLTest do
264264

265265
spans = LazyHTML.query(lazy_html, "span")
266266
parents = LazyHTML.parent_node(spans)
267-
parent_ids = parents |> Enum.flat_map(&LazyHTML.attribute(&1, "id")) |> Enum.sort()
267+
parent_ids = parents |> LazyHTML.attribute("id") |> Enum.sort()
268268
assert parent_ids == ["a", "b"]
269269

270270
# parent of div#id="a" is null
@@ -290,7 +290,7 @@ defmodule LazyHTMLTest do
290290

291291
spans = LazyHTML.query(lazy_html, "span")
292292
parents = LazyHTML.parent_node(spans)
293-
parent_ids = parents |> Enum.flat_map(&LazyHTML.attribute(&1, "id")) |> Enum.sort()
293+
parent_ids = parents |> LazyHTML.attribute("id") |> Enum.sort()
294294
assert parent_ids == ["b", "c"]
295295

296296
# since they share the same parent, we now only have one node left

0 commit comments

Comments
 (0)