8000 Use `ok_or_else()` in server-side certificate resolution. by briansmith · Pull Request #94 · rustls/rustls · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Use ok_or_else() in server-side certificate resolution. #94

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
Aug 20, 2017

Conversation

briansmith
Copy link
Contributor

Replace one use of the (anti-)pattern:

if x.is_none() {
   return Err(...)
};
x = x.unwrap();

The new code replaces a dynamic check for avoiding a panic with a
static assurance that there is no panic, in particular avoiding using
unwrap().

This is purely a stylistic change and shouldn't have any semantic
effect. There are probably other instances that should be changed too.
I changed this particular one just because I am interested in improving
the code in this area.

Replace one use of the (anti-)pattern:

```
if x.is_none() {
   return Err(...)
};
x = x.unwrap();
```

The new code replaces a dynamic check for avoiding a panic with a
static assurance that there is no panic, in particular avoiding using
`unwrap()`.

This is purely a stylistic change and shouldn't have any semantic
effect. There are probably other instances that should be changed too.
I changed this particular one just because I am interested in improving
the code in this area.
@coveralls
Copy link

Coverage Status

Coverage remained the same at 94.334% when pulling 2377e88 on briansmith:ok_or_else into 24a5c11 on ctz:master.

@ctz ctz merged commit 54c02de into rustls:master Aug 20, 2017
@ctz
Copy link
Member
ctz commented Aug 20, 2017

Thanks!

@briansmith briansmith deleted the ok_or_else branch August 29, 2017 01:58
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.

3 participants
0