Skip to content

Commit

Permalink
Rollup merge of #107535 - dcompoze:tcp-doc-unwrap, r=cuviper
Browse files Browse the repository at this point in the history
Replace unwrap with ? in TcpListener doc

The example in TcpListener doc returns `std::io::Result<()>` but the code inside the function uses `unwrap()` instead of `?`.
  • Loading branch information
GuillaumeGomez authored Jan 31, 2023
2 parents 9e0bfe0 + 943f833 commit adc3f8a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion library/std/src/net/tcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -829,7 +829,7 @@ impl TcpListener {
/// }
///
/// fn main() -> std::io::Result<()> {
/// let listener = TcpListener::bind("127.0.0.1:80").unwrap();
/// let listener = TcpListener::bind("127.0.0.1:80")?;
///
/// for stream in listener.incoming() {
/// match stream {
Expand Down

0 comments on commit adc3f8a

Please sign in to comment.