We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ac87c7d commit d83fdc1Copy full SHA for d83fdc1
rustler_mix/lib/rustler/compiler.ex
@@ -8,7 +8,8 @@ defmodule Rustler.Compiler do
8
def compile_crate(module, opts) do
9
shell = Mix.shell()
10
otp_app = Keyword.fetch!(opts, :otp_app)
11
- crate = Atom.to_string(Keyword.fetch!(opts, :crate))
+
12
+ crate = ensure_string(Keyword.fetch!(opts, :crate))
13
config = Config.from(otp_app, module, opts)
14
15
artifacts = Server.build()
@@ -43,4 +44,16 @@ defmodule Rustler.Compiler do
43
44
45
"crates/#{entry[:name]}/#{entry[:version]}/#{type}"
46
end
47
48
+ defp ensure_string(atom) when is_atom(atom) do
49
+ Atom.to_string(atom)
50
+ end
51
52
+ defp ensure_string(list) when is_list(list) do
53
+ IO.iodata_to_binary(list)
54
55
56
+ defp ensure_string(str) when is_binary(str) do
57
+ str
58
59
0 commit comments