Fix warnings raised on Elixir 1.7
This commit is contained in:
parent
ec55b3758f
commit
87b34f8464
4 changed files with 10 additions and 10 deletions
|
@ -218,7 +218,7 @@ defmodule RDF.Numeric do
|
|||
arg1, arg2, result_type ->
|
||||
if zero_value?(arg2) do
|
||||
cond do
|
||||
not result_type in [XSD.double] -> nil # TODO: or XSD.float
|
||||
result_type not in [XSD.double] -> nil # TODO: or XSD.float
|
||||
zero_value?(arg1) -> :nan
|
||||
negative_zero and arg1 < 0 -> :positive_infinity
|
||||
negative_zero -> :negative_infinity
|
||||
|
|
|
@ -31,7 +31,7 @@ defmodule RDF.IRI do
|
|||
"""
|
||||
def new(iri)
|
||||
def new(iri) when is_binary(iri), do: %RDF.IRI{value: iri}
|
||||
def new(qname) when is_atom(qname) and not qname in [nil, true, false],
|
||||
def new(qname) when is_atom(qname) and qname not in [nil, true, false],
|
||||
do: Namespace.resolve_term(qname)
|
||||
def new(%URI{} = uri), do: uri |> URI.to_string |> new
|
||||
def new(%RDF.IRI{} = iri), do: iri
|
||||
|
@ -45,7 +45,7 @@ defmodule RDF.IRI do
|
|||
"""
|
||||
def new!(iri)
|
||||
def new!(iri) when is_binary(iri), do: iri |> valid!() |> new()
|
||||
def new!(qname) when is_atom(qname) and not qname in [nil, true, false],
|
||||
def new!(qname) when is_atom(qname) and qname not in [nil, true, false],
|
||||
do: new(qname) # since terms of a namespace are already validated
|
||||
def new!(%URI{} = uri), do: uri |> valid!() |> new()
|
||||
def new!(%RDF.IRI{} = iri), do: valid!(iri)
|
||||
|
@ -96,7 +96,7 @@ defmodule RDF.IRI do
|
|||
def absolute?(%RDF.IRI{value: value}), do: absolute?(value)
|
||||
def absolute?(%URI{scheme: nil}), do: false
|
||||
def absolute?(%URI{scheme: _}), do: true
|
||||
def absolute?(qname) when is_atom(qname) and not qname in [nil, true, false] do
|
||||
def absolute?(qname) when is_atom(qname) and qname not in [nil, true, false] do
|
||||
qname |> Namespace.resolve_term |> absolute?()
|
||||
rescue
|
||||
_ -> false
|
||||
|
@ -180,7 +180,7 @@ defmodule RDF.IRI do
|
|||
"""
|
||||
def parse(iri)
|
||||
def parse(iri) when is_binary(iri), do: URI.parse(iri) |> empty_fragment_shim(iri)
|
||||
def parse(qname) when is_atom(qname) and not qname in [nil, true, false],
|
||||
def parse(qname) when is_atom(qname) and qname not in [nil, true, false],
|
||||
do: Namespace.resolve_term(qname) |> parse()
|
||||
def parse(%RDF.IRI{value: value}), do: URI.parse(value) |> empty_fragment_shim(value)
|
||||
def parse(%URI{} = uri), do: uri
|
||||
|
|
|
@ -28,7 +28,7 @@ defmodule RDF.List do
|
|||
"""
|
||||
def new(head, graph)
|
||||
|
||||
def new(head, graph) when is_atom(head) and not head in ~w[true false nil]a,
|
||||
def new(head, graph) when is_atom(head) and head not in ~w[true false nil]a,
|
||||
do: new(RDF.iri(head), graph)
|
||||
|
||||
def new(head, graph) do
|
||||
|
@ -175,7 +175,7 @@ defmodule RDF.List do
|
|||
do: do_node?(list_node, graph)
|
||||
|
||||
def node?(list_node, graph)
|
||||
when is_atom(list_node) and not list_node in ~w[true false nil]a,
|
||||
when is_atom(list_node) and list_node not in ~w[true false nil]a,
|
||||
do: do_node?(RDF.iri(list_node), graph)
|
||||
|
||||
def node?(_, _), do: false
|
||||
|
|
|
@ -286,7 +286,7 @@ defmodule RDF.Vocabulary.Namespace do
|
|||
|
||||
defp validate_terms!(terms) do
|
||||
with aliased_terms = aliased_terms(terms) do
|
||||
for {term, _} <- terms, not term in aliased_terms and not valid_term?(term) do
|
||||
for {term, _} <- terms, term not in aliased_terms and not valid_term?(term) do
|
||||
term
|
||||
end
|
||||
|> handle_invalid_terms!
|
||||
|
@ -327,7 +327,7 @@ defmodule RDF.Vocabulary.Namespace do
|
|||
|
||||
defp detect_invalid_characters(terms) do
|
||||
with aliased_terms = aliased_terms(terms) do
|
||||
for {term, _} <- terms, not term in aliased_terms and not valid_characters?(term),
|
||||
for {term, _} <- terms, term not in aliased_terms and not valid_characters?(term),
|
||||
do: term
|
||||
end
|
||||
end
|
||||
|
@ -381,7 +381,7 @@ defmodule RDF.Vocabulary.Namespace do
|
|||
end)
|
||||
|> Enum.filter(fn
|
||||
{term, true} ->
|
||||
if not term in aliased_terms do
|
||||
if term not in aliased_terms do
|
||||
proper_case?(term, base_iri, Atom.to_string(term), data)
|
||||
end
|
||||
{term, original_term} ->
|
||||
|
|
Loading…
Reference in a new issue