Refactor code to comply with credo suggestions
This commit is contained in:
parent
fb5cebc1b5
commit
6cf7c13228
21 changed files with 318 additions and 157 deletions
|
|
@ -30,13 +30,13 @@ defmodule Pleroma.XmlBuilder do
|
|||
NaiveDateTime.to_iso8601(time)
|
||||
end
|
||||
|
||||
def to_doc(content), do: "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" <> to_xml(content)
|
||||
def to_doc(content), do: ~s(<?xml version="1.0" encoding="UTF-8"?>) <> to_xml(content)
|
||||
|
||||
defp make_open_tag(tag, attributes) do
|
||||
attributes_string = for {attribute, value} <- attributes do
|
||||
"#{attribute}=\"#{value}\""
|
||||
end |> Enum.join(" ")
|
||||
|
||||
Enum.join([tag, attributes_string], " ") |> String.strip
|
||||
[tag, attributes_string] |> Enum.join(" ") |> String.strip
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue