Closed herou closed 3 years ago
@herou You've replaced the methods, which is good. But the real value of using
expect
comes from the string that you pass in explaining why the unwrapping couldn't possibly panic. The purpose of this issue is to provide those strings.For eample:
# Replace this let a = Some(4); let b = a.unwrap(); # With this let a = Some(4); let b = a.expect("a cannot be a None because I explicitly set it on the previously line.");
Here is an example of where it is already done correctly in the recipes
Got your idea, I just set a default text for now to the expect method in order to pass the tests
@wheresaddie, @wheresaddie Since I do not know very well the project I need a bit of help from you guys. The expect("msg to print") method should print meaningful msg. Would be nice if you can provide the list of the msg that you want to print and then I can replace them. Note: The state of this PR should be open!
Please use GitHub's "Convert to draft" feature for PRs that are not yet ready to merge...it's kind of easy to miss
There's also a label for that. It's useful when you want to CI to run but don't want the PR accidentally merged.
thanks @JoshOrndorff
The title itself is very descriptive. This PR comes from #369 issue.