-
Notifications
You must be signed in to change notification settings - Fork 64
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
Validate tweaks #148
Merged
Merged
Validate tweaks #148
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
```warning: use of `unwrap_or` followed by a function call --> src/cmd/validate.rs:81:44 | 81 | let input_path: &str = &args.arg_input.unwrap_or("stdin.csv".to_string()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| "stdin.csv".to_string())` | = note: `#[warn(clippy::or_fun_call)]` on by default = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#or_fun_call warning: use of `unwrap_or` followed by a function call --> src/cmd/validate.rs:83:47 | 83 | let valid_suffix: &str = &args.flag_valid.unwrap_or("valid".to_string()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| "valid".to_string())` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#or_fun_call warning: use of `unwrap_or` followed by a function call --> src/cmd/validate.rs:86:51 | 86 | let invalid_suffix: &str = &args.flag_invalid.unwrap_or("invalid".to_string()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| "invalid".to_string())` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#or_fun_call warning: `to_string` applied to a type that implements `Display` in `format!` args --> src/cmd/validate.rs:112:96 | 112 | ... return fail!(format!("Cannot compile schema json. error: {}", e.to_string())); | ^^^^^^^^^^^^ help: remove this | = note: `#[warn(clippy::to_string_in_format_args)]` on by default = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args warning: `to_string` applied to a type that implements `Display` in `format!` args --> src/cmd/validate.rs:118:89 | 118 | return fail!(format!("Unable to parse schema json. error: {}", e.to_string())); | ^^^^^^^^^^^^ help: remove this | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args warning: `to_string` applied to a type that implements `Display` in `format!` args --> src/cmd/validate.rs:123:77 | 123 | return fail!(format!("Unable to retrieve json. error: {}", e.to_string())); | ^^^^^^^^^^^^ help: remove this | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args warning: `to_string` applied to a type that implements `Display` in `format!` args --> src/cmd/validate.rs:145:107 | 145 | return fail!(format!("Unable to convert CSV to json. row: {}, error: {}", row_index, e.to_string())); | ^^^^^^^^^^^^ help: remove this | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args warning: `to_string` applied to a type that implements `Display` in `format!` args --> src/cmd/validate.rs:210:96 | 210 | return fail!(format!("Unable to validate. row: {}, error: {}", row_index, e.to_string())); | ^^^^^^^^^^^^ help: remove this | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args warning: useless use of `format!` --> src/cmd/validate.rs:242:19 | 242 | let msg = format!("Can't validate without schema, but csv looks good."); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Can't validate without schema, but csv looks good.".to_string()` | = note: `#[warn(clippy::useless_format)]` on by default = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format warning: this loop could be written as a `for` loop --> src/cmd/validate.rs:262:9 | 262 | while let Some((i, header)) = headers_iter.next() { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for (i, header) in headers_iter` | = note: `#[warn(clippy::while_let_on_iterator)]` on by default = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator warning: writing `&String` instead of `&str` involves a new object where a slice will do --> src/cmd/validate.rs:520:19 | 520 | fn load_json(uri: &String) -> Result<String> { | ^^^^^^^ help: change this to: `&str` | = note: `#[warn(clippy::ptr_arg)]` on by default = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg warning: `qsv` (bin "qsvlite") generated 11 warnings (7 duplicates) warning: `qsv` (bin "qsv") generated 11 warnings (4 duplicates) ```
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Some tweaks: