Skip to content

Commit

Permalink
Merge pull request #8 from theodowling/master
Browse files Browse the repository at this point in the history
Resolve build warnings of deprecated String.strip/1 method
  • Loading branch information
schultyy committed Jul 28, 2023
2 parents ac24f69 + 98bc5d4 commit 6ea70af
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/mustache.ex
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ defmodule Mustache do
first_scan = List.first(scans)
variable = first_scan |> clean(["{{", "}}"])
value = if escape?(first_scan) do
key = variable |> String.strip
key = variable |> String.trim
data |> indifferent_access(key) |> to_string |> escape
else
key = String.replace(variable, "&", "") |> String.strip
key = String.replace(variable, "&", "") |> String.trim
data |> indifferent_access(key) |> to_string
end
if value == nil do
Expand Down Expand Up @@ -101,7 +101,7 @@ defmodule Mustache do
[] -> template
_ ->
variable = List.first(scans) |> clean(["{{{", "}}}"])
key = variable |> String.strip
key = variable |> String.trim
value = data |> indifferent_access(key) |> to_string
if value == nil do
template
Expand Down

0 comments on commit 6ea70af

Please sign in to comment.