Skip to content

Commit

Permalink
Add guards to Kino.Layout, closes #400 (#401)
Browse files Browse the repository at this point in the history
  • Loading branch information
josevalim authored Mar 18, 2024
1 parent 9a0a25c commit a4cc274
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/kino/layout.ex
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ defmodule Kino.Layout do
"""
@spec tabs(list({String.t() | atom(), term()})) :: t()
def tabs(tabs) do
def tabs(tabs) when is_list(tabs) do
{labels, terms} = Enum.unzip(tabs)
labels = Enum.map(labels, &to_string/1)
info = %{labels: labels}
Expand Down Expand Up @@ -62,7 +62,7 @@ defmodule Kino.Layout do
"""
@spec grid(list(term()), keyword()) :: t()
def grid(terms, opts \\ []) do
def grid(terms, opts \\ []) when is_list(terms) do
opts = Keyword.validate!(opts, columns: 1, boxed: false, gap: 8)

info = %{
Expand Down

0 comments on commit a4cc274

Please sign in to comment.