Skip to content

Commit 7298055

Browse files
kiseitai3kiseitai3
authored and
kiseitai3
committed
docs: Small clarification on the usage of read_to_string and read_to_end trait methods.
1 parent 8587e1a commit 7298055

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

library/std/src/io/mod.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -923,8 +923,8 @@ pub trait Read {
923923
/// that do not send EOF. In these cases, `read_to_end` will block indefinitely. Standard input
924924
/// is one such stream which may be finite if piped, but is typically continuous. For example,
925925
/// `cat <file> | <my_rust_program>` will correctly terminate with an `EOF` upon closure of cat.
926-
/// `yes "Data" | pv | <my_rust_program` or `tail -f <file> | <my_rust_program>` may not close
927-
/// the stream or insert an `EOF` termination character.
926+
/// Reading user input or running programs that remain open indefinitely will never terminate
927+
/// the stream with `EOF` (e.g. `yes "Data" | pv | <my_rust_program`).
928928
///
929929
/// Using `.lines()` with a [`BufReader`] or using [`read`] can provide a better solution
930930
///
@@ -975,10 +975,10 @@ pub trait Read {
975975
///
976976
/// `read_to_string` attempts to read a source until EOF, but many sources are continuous streams
977977
/// that do not send EOF. In these cases, `read_to_string` will block indefinitely. Standard input
978-
/// is one such stream which may be finite if piped, but is typically continuous. For example,
978+
/// is one such stream which may be finite if piped, but is typically continuous. FFor example,
979979
/// `cat <file> | <my_rust_program>` will correctly terminate with an `EOF` upon closure of cat.
980-
/// `yes "Data" | pv | <my_rust_program` or `tail -f <file> | <my_rust_program>` may not close
981-
/// the stream or insert an `EOF` termination character.
980+
/// Reading user input or running programs that remain open indefinitely will never terminate
981+
/// the stream with `EOF` (e.g. `yes "Data" | pv | <my_rust_program`).
982982
///
983983
/// Using `.lines()` with a [`BufReader`] or using [`read`] can provide a better solution
984984
///
@@ -1291,8 +1291,8 @@ pub trait Read {
12911291
/// that do not send EOF. In these cases, `read_to_string` will block indefinitely. Standard input
12921292
/// is one such stream which may be finite if piped, but is typically continuous. For example,
12931293
/// `cat <file> | <my_rust_program>` will correctly terminate with an `EOF` upon closure of cat.
1294-
/// `yes "Data" | pv | <my_rust_program` or `tail -f <file> | <my_rust_program>` may not close
1295-
/// the stream or insert an `EOF` termination character.
1294+
/// Reading user input or running programs that remain open indefinitely will never terminate
1295+
/// the stream with `EOF` (e.g. `yes "Data" | pv | <my_rust_program`).
12961296
///
12971297
/// Using `.lines()` with a [`BufReader`] or using [`read`] can provide a better solution
12981298
#[stable(feature = "io_read_to_string", since = "1.65.0")]

0 commit comments

Comments
 (0)