Skip to content

RUST-781 Remove unwraps from examples #474

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 27, 2021

Conversation

abr-egn
Copy link
Contributor

@abr-egn abr-egn commented Sep 24, 2021

RUST-781

This removes uses of unwrap from example code; only one of these was actually in the example portion. There are a bunch of remaining unwraps but they're in various places (macros, closures) that would be nontrivial to remove and not produce any benefit.

Copy link
Contributor

@patrickfreed patrickfreed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To clarify: did you also check the examples included in the docstrings of modules / types? The changes here are good, but the scope of the ticket also includes those examples, since they'll be included in the docs.rs page for the driver. These ones actually won't be on docs.rs, but they should be included in the MongoDB documentation. I'm noticing now that a ticket may never have been filed for some of the older ones unfortunately, so once this PR goes in I'll go ahead and do that.

@abr-egn
Copy link
Contributor Author

abr-egn commented Sep 27, 2021

Apologies, I should have mentioned - yes, I looked for docstrings with unwrap and couldn't find any. There are a few comments that reference unwrap but they're generally of the "// This unwrap is okay because ..." form.

@abr-egn abr-egn force-pushed the RUST-781/example-nounwrap branch from daf6650 to 7ef2cae Compare September 27, 2021 20:04
@abr-egn abr-egn merged commit 1b643df into mongodb:master Sep 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants