         separator = Keyword.get(opts, :separator, @container_separator)
 
         {docs, simple?} =
-          container_each(collection, inspect.limit, inspect, fun, [], break == :maybe)
+          container_each(collection, inspect_opts.limit, inspect_opts, fun, [], break == :maybe)
 
         flex? = simple? or break == :flex
         docs = fold_doc(docs, &join(&1, &2, flex?, separator))


  ## Examples

      iex> inspect = %Inspect.Opts{limit: :infinity}
      iex> fun = fn i, _opts -> to_string(i) end
      iex> doc = Inspect.Algebra.container_doc("[", Enum.to_list(1..5), "]", inspect, fun)
      iex> Inspect.Algebra.format(doc, 5) |> IO.iodata_to_binary()
      "[1,\n 2,\n 3,\n 4,\n 5]"

      iex> inspect = %Inspect.Opts{limit: 3}
      iex> fun = fn i, _opts -> to_string(i) end
      iex> doc = Inspect.Algebra.container_doc("[", Enum.to_list(1..5), "]", inspect, fun)
      iex> Inspect.Algebra.format(doc, 20) |> IO.iodata_to_binary()
      "[1, 2, 3, ...]"

      iex> inspect = %Inspect.Opts{limit: 3}
      iex> fun = fn i, _opts -> to_string(i) end
      iex> opts = [separator: "!"]
      iex> doc = Inspect.Algebra.container_doc("[", Enum.to_list(1..5), "]", inspect, fun, opts)
      iex> Inspect.Algebra.format(doc, 20) |> IO.iodata_to_binary()
      "[1! 2! 3! ...]"


defmodule Inspect.Opts do
  @moduledoc """
  Defines the options used by the `Inspect` protocol.

  The following fields are available:

