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

2.5.1 节,if判断不建议使用小括号 #323

Open
pkubangbang opened this issue Aug 26, 2021 · 1 comment
Open

2.5.1 节,if判断不建议使用小括号 #323

pkubangbang opened this issue Aug 26, 2021 · 1 comment
Labels
第二章 第二章 读者建议 来自读者对本书的建议

Comments

@pkubangbang
Copy link

页码与行数

  • 第22页
  • 代码清单2-16
  • 第三行

代码错误

let big_n = if (n < 10 && n > -10) { // 小括号导致warning

Rust Playground Demo

https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=08e03bc15c70e2e26eeff1559bbd7672

错误信息

warning: unnecessary parentheses around `if` condition
@ZhangHanDong
Copy link
Owner

感谢反馈

@ZhangHanDong ZhangHanDong added 第二章 第二章 读者建议 来自读者对本书的建议 labels Aug 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
第二章 第二章 读者建议 来自读者对本书的建议
Projects
None yet
Development

No branches or pull requests

2 participants