   ## get_line
 
   defp get_line(encoding, prompt,
-                state(input: input, output: output, capture_prompt: capture_prompt) = s) do
+                %StringIO{input: input, output: output, capture_prompt: capture_prompt} = s) do
     case :unicode.characters_to_list(input, encoding) do
       {:error, _, _} ->
         {{:error, :collect_line}, s}


  def init({string, options}) do
    capture_prompt = options[:capture_prompt] || false
    {:ok, state(input: string, capture_prompt: capture_prompt)}
  end

  def handle_info({:io_request, from, reply_as, req}, s) do

            _ -> :unicode.characters_to_binary(input, encoding)
          end

        {result, %StringIO{s | input: input, output: output}}
    end
  end

