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

Fix clippy warnings #1149

Merged
merged 3 commits into from
Nov 4, 2018
Merged

Fix clippy warnings #1149

merged 3 commits into from
Nov 4, 2018

Conversation

hayd
Copy link
Contributor

@hayd hayd commented Nov 4, 2018

Run with:
$ DENO_BUILD_PATH=`pwd`/out/debug cargo clippy

There's still one remaining suppressed (due to rust-lang/rust-clippy#1684)

https://github.com/rust-lang-nursery/rust-clippy

hayd added 3 commits November 4, 2018 02:35
Run with:
$ DENO_BUILD_PATH=`pwd`/out/debug cargo clippy

There's still one remaining:
```
warning: Try not to call a closure in the expression where it is declared.
    --> src/ops.rs:1128:36
     |
1128 |     Box::new(futures::future::result((move || {
     |  ____________________________________^
1129 | |     // TODO properly parse addr
1130 | |     let addr = SocketAddr::from_str(address).unwrap();
1131 | |
...    |
1148 | |     ))
1149 | |   })()))
     | |______^
     |
     = note: #[warn(clippy::redundant_closure_call)] on by default
     = help: for further information visit https://rust-lang-nursery.github.io/rust-clippy/v0.0.212/index.html#redundant_closure_call
help: Try doing something like:
     |
1128 |   Box::new(futures::future::result({
1129 |     // TODO properly parse addr
1130 |     let addr = SocketAddr::from_str(address).unwrap();
1131 |
1132 |     let listener = TcpListener::bind(&addr)?;
1133 |     let resource = resources::add_tcp_listener(listener);
```

https://github.com/rust-lang-nursery/rust-clippy
Copy link
Member

@ry ry left a comment

Choose a reason for hiding this comment

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

LGTM - nice fixes! It would be great to have this run as part of tools/lint.py

@ry ry merged commit 1241b8e into denoland:master Nov 4, 2018
@hayd hayd deleted the clippy branch November 4, 2018 14:19
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