   end
 
   defp do_render(conn, template, format, assigns) do
-    import Phoenix.Endpoint, only: [instrument: 3, instrument: 4]
-
     assigns = to_map(assigns)
     content_type = Plug.MIME.type(format)
     conn =

  alias Plug.Conn.AlreadySentError

  require Logger

  @unsent [:unset, :set]


    view = Map.get(conn.private, :phoenix_view) ||
            raise "a view module was not specified, set one with put_view/2"

    data = Phoenix.Endpoint.instrument conn, :phoenix_controller_render, template <> format, fn ->
      Phoenix.View.render_to_iodata(view, template, Map.put(conn.assigns, :conn, conn))
    end

