Skip to content
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

Semantic error #23

Closed
mmm9527 opened this issue Jun 6, 2017 · 2 comments
Closed

Semantic error #23

mmm9527 opened this issue Jun 6, 2017 · 2 comments

Comments

@mmm9527
Copy link

mmm9527 commented Jun 6, 2017

In the file lib. rs ,Lines 73 to 80 :

fn promote_tls_error(&mut self) -> io::Result<()> {
    match self.tls_error.take() {
      Some(err) => {
        return Err(io::Error::new(io::ErrorKind::ConnectionAborted, err));
      },
      None => return Ok(())
    };
  }

is that correct? Should remove the ';'?

@lucab
Copy link
Contributor

lucab commented Jun 14, 2017

It is formally correct because both arms have explicit returns so nothing relies on the final result of expression evaluation. However, I agree it would be more idiomatic to drop both return and the ; alltogether. I think clippy also highlights this nowadays.

@ctz
Copy link
Member

ctz commented Jun 18, 2017

This code was deleted in the recent merge.

@ctz ctz closed this as completed Jun 18, 2017
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

No branches or pull requests

3 participants