Skip to content

Commit a279ebb

Browse files
authored
Rollup merge of #66346 - linkmauve:try-in-docstring, r=Dylan-DPC
Replace .unwrap() with ? in std::os::unix::net As people like to copy examples, this gives them good habits.
2 parents 4007d4e + be18a22 commit a279ebb

File tree

2 files changed

+284
-156
lines changed

2 files changed

+284
-156
lines changed

src/libstd/sys/unix/ext/mod.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,13 @@
1515
//! use std::fs::File;
1616
//! use std::os::unix::prelude::*;
1717
//!
18-
//! fn main() {
19-
//! let f = File::create("foo.txt").unwrap();
18+
//! fn main() -> std::io::Result<()> {
19+
//! let f = File::create("foo.txt")?;
2020
//! let fd = f.as_raw_fd();
2121
//!
2222
//! // use fd with native unix bindings
23+
//!
24+
//! Ok(())
2325
//! }
2426
//! ```
2527

0 commit comments

Comments
 (0)