net: add note about into_split's drop (#2567)

This took me a bit to catch on to because I didn't really think there was any reason to investigate the individual documentation of each half. As someone dealing with TCP streams directly for first time (without previous experience from other languages) this caught me by surprise
This commit is contained in:
Mathspy
2020-05-28 10:11:55 +02:00
committed by GitHub
parent 954f2b7304
commit f7574d9023
+2
View File
@@ -652,6 +652,8 @@ impl TcpStream {
/// Unlike [`split`], the owned halves can be moved to separate tasks, however
/// this comes at the cost of a heap allocation.
///
/// **Note:** Dropping the write half will close the TCP stream in both directions.
///
/// [`split`]: TcpStream::split()
pub fn into_split(self) -> (OwnedReadHalf, OwnedWriteHalf) {
split_owned(self)