Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upUse `?` in docs instead of unwrapping #52
Conversation
budziq
suggested changes
Jun 17, 2017
| @@ -1,6 +1,6 @@ | |||
| language: rust | |||
| rust: | |||
| - 1.10.0 | |||
| - 1.18.0 | |||
This comment has been minimized.
This comment has been minimized.
budziq
Jun 17, 2017
•
Contributor
I guess that the whole point of this travis entry was to check for backwards compatibility with older rust versions (not check with the latest stable
Please note that "?" became stable in 1.13.0. @BurntSushi will have to decide if he wants to drop backwards compatibility with 1.10 for the sake of "?" in examples. Otherwise the try! macro would have to be used instead.
This comment has been minimized.
This comment has been minimized.
msehnout
Jun 17, 2017
Author
Contributor
Sorry, I didn't know :-) Anyway I was following this guideline:
https://github.com/brson/rust-api-guidelines#examples-use--not-try-not-unwrap-c-question-mark
| @@ -67,7 +79,8 @@ This uses the `filter_entry` iterator adapter to avoid yielding hidden files | |||
| and directories efficiently: | |||
| ```rust,no_run | |||
| use walkdir::{DirEntry, WalkDir, WalkDirIterator}; | |||
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
| @@ -28,12 +28,18 @@ The following code recursively iterates over the directory given and prints | |||
| the path for each entry: | |||
| ```rust,no_run | |||
| use walkdir::WalkDir; | |||
| use walkdir::{Error, WalkDir}; | |||
This comment has been minimized.
This comment has been minimized.
budziq
Jun 17, 2017
Contributor
i would suggest splitting the use here into two lines and biding the Error line as it should be part of the hidden error boilerplate.
this concerns all examples below.
This comment has been minimized.
This comment has been minimized.
| # fn try_main() -> Result<(), Error> { |
This comment has been minimized.
This comment has been minimized.
budziq
Jun 17, 2017
Contributor
as far as i know the convention is fn run() but its not super important.
This comment has been minimized.
This comment has been minimized.
msehnout
Jun 17, 2017
Author
Contributor
Again, I was following this guideline and they use try_main() there:
https://github.com/brson/rust-api-guidelines#examples-use--not-try-not-unwrap-c-question-mark
This comment has been minimized.
This comment has been minimized.
msehnout
force-pushed the
msehnout:master
branch
2 times, most recently
from
b984671
to
b2e3670
Jun 19, 2017
This comment has been minimized.
This comment has been minimized.
|
@budziq I've submitted a new version of this PR with fixed issues and reverted travis.yml. |
This comment has been minimized.
This comment has been minimized.
|
@msehnout reverting the travis.yml might be a little bit to early as now the travis build for backwards compatibility (rust 1.10.0) fails. Please note that the
I would suggest option 1. but it is not my place to decide I would suggest updating the PR to make it pass travis test. Chose one of the two options and wait for maintainers approval or suggestions. |
This comment has been minimized.
This comment has been minimized.
|
@budziq I think I'll just wait for @BurntSushi's opinion. |
This comment has been minimized.
This comment has been minimized.
|
Since we're releasing a |
budziq
referenced this pull request
Jun 27, 2017
Merged
Bumped the minimal required rust version to 1.16.0 #62
This comment has been minimized.
This comment has been minimized.
|
Sounds good to me. Once the version in travis is changed, I can rebase this patch to run CI again. |
This comment has been minimized.
This comment has been minimized.
|
Or should I bump it? |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Thanks! I think this is ready to go but needs a rebase first. |
This comment has been minimized.
This comment has been minimized.
|
Ok, I have the fix, but I cannot authenticate against Github. Seems to be broken using either https or ssh. I'll submit the patch later. |
msehnout
force-pushed the
msehnout:master
branch
from
b2e3670
to
672499f
Jun 30, 2017
This comment has been minimized.
This comment has been minimized.
|
It should be ready. |
BurntSushi
merged commit 938b0fa
into
BurntSushi:master
Jun 30, 2017
This comment has been minimized.
This comment has been minimized.
|
Awesome, thank you! |
msehnout commentedJun 16, 2017
Fixes: #25 except for "examples on WalkDirIterator.skip_current_dir" because there is no unwrap()