Function tokio::io::util::read_line::finish_string_read

source ยท
pub(super) fn finish_string_read(
    io_res: Result<usize>,
    utf8_res: Result<String, FromUtf8Error>,
    read: usize,
    output: &mut String,
    truncate_on_io_error: bool,
) -> Poll<Result<usize>>
Expand description

This handles the various failure cases and puts the string back into output.

The truncate_on_io_error bool is necessary because read_to_string and read_line disagree on what should happen when an IO error occurs.