Skip to content

Commit 9ac2ffd

Browse files
committed
optimize cast to remove ensure_loaded?
1 parent 7a45731 commit 9ac2ffd

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/construct/type.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ defmodule Construct.Type do
149149
def cast(type, term, opts) when is_atom(type) do
150150
cond do
151151
not primitive?(type) ->
152-
if Code.ensure_loaded?(type) && function_exported?(type, :cast, 2) do
152+
if function_exported?(type, :cast, 2) do
153153
type.cast(term, opts)
154154
else
155155
type.cast(term)

0 commit comments

Comments
 (0)