Skip to content

Commit e5277c1

Browse files
committed
Auto merge of #49357 - frewsxcv:frewsxcv-termination-doc-examples, r=GuillaumeGomez
Remove hidden `foo` functions from doc examples; use `Termination` trait. Fixes #49233. Easier to review with the white-space ignoring `?w=1` feature: https://github.com/rust-lang/rust/pull/49357/files?w=1
2 parents 1169541 + e9dcec0 commit e5277c1

File tree

13 files changed

+1130
-1127
lines changed

13 files changed

+1130
-1127
lines changed

src/libstd/env.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -552,17 +552,17 @@ pub fn home_dir() -> Option<PathBuf> {
552552
///
553553
/// [msdn]: https://msdn.microsoft.com/en-us/library/windows/desktop/aa364992(v=vs.85).aspx
554554
///
555-
/// ```
555+
/// ```no_run
556556
/// use std::env;
557557
/// use std::fs::File;
558558
///
559-
/// # fn foo() -> std::io::Result<()> {
560-
/// let mut dir = env::temp_dir();
561-
/// dir.push("foo.txt");
559+
/// fn main() -> std::io::Result<()> {
560+
/// let mut dir = env::temp_dir();
561+
/// dir.push("foo.txt");
562562
///
563-
/// let f = File::create(dir)?;
564-
/// # Ok(())
565-
/// # }
563+
/// let f = File::create(dir)?;
564+
/// Ok(())
565+
/// }
566566
/// ```
567567
#[stable(feature = "env", since = "1.0.0")]
568568
pub fn temp_dir() -> PathBuf {

0 commit comments

Comments
 (0)