   ## 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}

          output = << output :: binary, String.from_char_data!(prompt) :: binary >>
        end

        {result, state(s, input: input, output: output)}
    end
  end



  use GenServer.Behaviour

  defstruct input: "", output: "", capture_prompt: false

  @doc """
  Creates an IO device.
