let of_char_stream cstr =
let f _ = match Stream.peek cstr with
| None -> None
| Some _ ->
let ans = Buffer.create 100 in
let rec loop () = match Stream.next cstr with
| Some c ->
if c <> '\n' then (Buffer.add_char ans c; loop())
| None -> ()
in
loop();
Some (Buffer.contents ans |> Line.of_string_unsafe)
in
Stream.from f