Skip to content

Commit

Permalink
Applying suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
cristineguadelupe committed Sep 4, 2023
1 parent 8d537af commit 12ff20d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/kino/remote_cell.ex
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ defmodule Kino.RemoteCell do
end

defp to_quoted(%{"node" => node, "cookie" => cookie, "assign_to" => var}, {:ok, code}) do
valid = Kino.SmartCell.valid_variable_name?(var)
call = build_call(code) |> build_var(var, valid)
var = if Kino.SmartCell.valid_variable_name?(var), do: var
call = build_call(code) |> build_var(var)

quote do
node = unquote(String.to_atom(node))
Expand All @@ -78,9 +78,9 @@ defmodule Kino.RemoteCell do
end
end

defp build_var(call, _var, false), do: call
defp build_var(call, nil), do: call

defp build_var(call, var, true) do
defp build_var(call, var) do
quote do
unquote({String.to_atom(var), [], nil}) = unquote(call)
end
Expand Down

0 comments on commit 12ff20d

Please sign in to comment.