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

Codebase has many redundant use statements #11

Closed
0atman opened this issue Jan 13, 2021 · 3 comments
Closed

Codebase has many redundant use statements #11

0atman opened this issue Jan 13, 2021 · 3 comments

Comments

@0atman
Copy link

0atman commented Jan 13, 2021

I happened to run clippy on the code, and there's quite a lot of these:

warning: this import is redundant
 --> src/main.rs:7:1
  |
7 | use serde_json;
  | ^^^^^^^^^^^^^^^ help: remove it entirely
  |
  = note: `#[warn(clippy::single_component_path_imports)]` on by default
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_component_path_imports

warning: this import is redundant
 --> src/errors.rs:1:1
  |
1 | use std;
  | ^^^^^^^^ help: remove it entirely
  |
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_component_path_imports

warning: this import is redundant
 --> src/errors.rs:2:1
  |
2 | use url;
  | ^^^^^^^^ help: remove it entirely
  |
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_component_path_imports

warning: this import is redundant
 --> src/errors.rs:3:1
  |
3 | use tungstenite;
  | ^^^^^^^^^^^^^^^^ help: remove it entirely
  |
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_component_path_imports

warning: this import is redundant
 --> src/nettfiske.rs:1:1
  |
1 | use fern;
  | ^^^^^^^^^ help: remove it entirely
  |
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_component_path_imports

warning: this import is redundant
 --> src/nettfiske.rs:2:1
  |
2 | use chrono;
  | ^^^^^^^^^^^ help: remove it entirely
  |
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_component_path_imports

warning: 6 warnings emitted

What do you think about this? I'm new to rust, so perhaps this pattern is OK?

@0atman
Copy link
Author

0atman commented Jan 13, 2021

@wisespace-io
Copy link
Owner

@0atman They are redundant. I removed. Thank you for running clippy.

@0atman
Copy link
Author

0atman commented Jan 13, 2021

My pleasure, nice fixes 👌

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

2 participants