env: remove unwrap in examples in favor of try op#50736
Merged
bors merged 1 commit intorust-lang:masterfrom May 17, 2018
udoprog:env-try-op
Merged
env: remove unwrap in examples in favor of try op#50736bors merged 1 commit intorust-lang:masterfrom udoprog:env-try-op
bors merged 1 commit intorust-lang:masterfrom
udoprog:env-try-op
Conversation
Contributor
|
r? @shepmaster (rust_highfive has picked a reviewer for you, use r? to override) |
Member
|
I think I'm generally in favor of this, but I'm hesitant to accept it as-is because doctests will be getting the ability to use I could see if we used the +/// # fn main() -> std::io::Result<()> {
+/// let path = env::current_dir()?;
+/// println!("The current directory is {}", path.display());
+/// # Ok(())
+/// # }But I wonder if hiding the |
Contributor
Author
|
@shepmaster this is only documentation, we can patch it again when try-op is available for doctests. This change puts it in line with other similar doctests (e.g. https://doc.rust-lang.org/std/io/trait.Read.html) which will also have to be patched later. |
Member
|
Ah, alright then. @bors r+ |
Collaborator
|
📌 Commit f73c4a4 has been approved by |
Member
|
@bors rollup |
Member
|
Thanks! |
kennytm
added a commit
to kennytm/rust
that referenced
this pull request
May 16, 2018
env: remove unwrap in examples in favor of try op
bors
added a commit
that referenced
this pull request
May 17, 2018
Rollup of 17 pull requests Successful merges: - #50170 (Implement From for more types on Cow) - #50638 (Don't unconditionally set CLOEXEC twice on every fd we open on Linux) - #50656 (Fix `fn main() -> impl Trait` for non-`Termination` trait) - #50669 (rustdoc: deprecate `#![doc(passes, plugins, no_default_passes)]`) - #50726 (read2: Use inner function instead of closure) - #50728 (Fix rustdoc panic with `impl Trait` in type parameters) - #50736 (env: remove unwrap in examples in favor of try op) - #50740 (Remove LazyBTreeMap.) - #50752 (Add missing error codes in libsyntax-ext asm) - #50779 (Make mutable_noalias and arg_align_attributes be tracked) - #50787 (Fix run-make wasm tests) - #50788 (Fix an ICE when casting a nonexistent const) - #50789 (Ensure libraries built in stage0 have unique metadata) - #50793 (tidy: Add a check for empty UI test files) - #50797 (fix a typo in signed-integer::from_str_radix()) - #50808 (Stabilize num::NonZeroU*) - #50809 (GitHub: Stop treating Cargo.lock as a generated file.) Failed merges:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.