Dependency bump and clippy#347
Merged
tafia merged 14 commits intotafia:masterfrom Aug 21, 2023
jqnatividad:dependency-bump_and_clippy
Merged
Dependency bump and clippy#347tafia merged 14 commits intotafia:masterfrom jqnatividad:dependency-bump_and_clippy
tafia merged 14 commits intotafia:masterfrom
jqnatividad:dependency-bump_and_clippy
Conversation
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/xls.rs:1003:42
|
1003 | .map_or("#REF", |sh| &sh);
| ^^^ help: change this to: `sh`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
= note: `#[warn(clippy::needless_borrow)]` on by default
warning: this argument is a mutable reference, but not used mutably
--> src/xls.rs:610:53
|
610 | fn parse_short_string(r: &mut Record<'_>, encoding: &mut XlsEncoding) -> Result<String, XlsError> {
| ^^^^^^^^^^^^^^^^ help: consider changing to: `&XlsEncoding`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_ref_mut
= note: `#[warn(clippy::needless_pass_by_ref_mut)]` on by default
warning: this argument is a mutable reference, but not used mutably
--> src/xls.rs:627:37
|
627 | fn parse_string(r: &[u8], encoding: &mut XlsEncoding) -> Result<String, XlsError> {
| ^^^^^^^^^^^^^^^^ help: consider changing to: `&XlsEncoding`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_ref_mut
warning: this argument is a mutable reference, but not used mutably
--> src/xls.rs:725:16
|
725 | fn parse_xf(r: &mut Record<'_>) -> Result<u16, XlsError> {
| ^^^^^^^^^^^^^^^ help: consider changing to: `&Record<'_>`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_ref_mut
warning: this argument is a mutable reference, but not used mutably
--> src/xls.rs:742:15
|
742 | encoding: &mut XlsEncoding,
| ^^^^^^^^^^^^^^^^ help: consider changing to: `&XlsEncoding`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_ref_mut
warning: this argument is a mutable reference, but not used mutably
--> src/xls.rs:816:15
|
816 | encoding: &mut XlsEncoding,
| ^^^^^^^^^^^^^^^^ help: consider changing to: `&XlsEncoding`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_ref_mut
warning: this argument is a mutable reference, but not used mutably
--> src/xls.rs:839:15
|
839 | encoding: &mut XlsEncoding,
| ^^^^^^^^^^^^^^^^ help: consider changing to: `&XlsEncoding`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_ref_mut
warning: this argument is a mutable reference, but not used mutably
--> src/xls.rs:841:10
|
841 | len: &mut usize,
| ^^^^^^^^^^ help: consider changing to: `&usize`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_ref_mut
warning: this argument is a mutable reference, but not used mutably
--> src/xls.rs:463:15
|
463 | encoding: &mut XlsEncoding,
| ^^^^^^^^^^^^^^^^ help: consider changing to: `&XlsEncoding`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_ref_mut
= note: `#[warn(clippy::needless_pass_by_ref_mut)]` on by default
warning: this argument is a mutable reference, but not used mutably
--> src/xls.rs:768:15
|
768 | encoding: &mut XlsEncoding,
| ^^^^^^^^^^^^^^^^ help: consider changing to: `&XlsEncoding`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_ref_mut
warning: this argument is a mutable reference, but not used mutably
--> src/xls.rs:985:15
|
985 | encoding: &mut XlsEncoding,
| ^^^^^^^^^^^^^^^^ help: consider changing to: `&XlsEncoding`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_ref_mut
warning: you don't need to add `&` to all patterns
--> src/xls.rs:1304:5
|
1304 | / match r {
1305 | | &[0x00, .., 0xFF, 0xFF] => Ok(None), // String, value should be in next record
1306 | | &[0x01, _, b, .., 0xFF, 0xFF] => Ok(Some(DataType::Bool(b != 0))),
1307 | | &[0x02, _, e, .., 0xFF, 0xFF] => parse_err(e).map(Some),
... |
1312 | | _ => Ok(Some(DataType::Float(read_f64(r)))),
1313 | | }
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_ref_pats
= note: `#[warn(clippy::match_ref_pats)]` on by default
help: instead of prefixing all patterns with `&`, you can dereference the expression
|
1304 ~ match *r {
1305 ~ [0x00, .., 0xFF, 0xFF] => Ok(None), // String, value should be in next record
1306 ~ [0x01, _, b, .., 0xFF, 0xFF] => Ok(Some(DataType::Bool(b != 0))),
1307 ~ [0x02, _, e, .., 0xFF, 0xFF] => parse_err(e).map(Some),
1308 ~ [e, .., 0xFF, 0xFF] => Err(XlsError::Unrecognized {
warning: the function `parse_format` doesn't need a mutable reference
--> src/xls.rs:292:66
|
292 | let (idx, format) = parse_format(&mut r, &mut encoding)?;
| ^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_mut_passed
= note: `#[warn(clippy::unnecessary_mut_passed)]` on by default
warning: the function `parse_xf` doesn't need a mutable reference
--> src/xls.rs:297:43
|
297 | xfs.push(parse_xf(&mut r)?);
| ^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_mut_passed
warning: the function `parse_sheet_name` doesn't need a mutable reference
--> src/xls.rs:301:68
|
301 | let (pos, name) = parse_sheet_name(&mut r, &mut encoding)?;
| ^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_mut_passed
warning: the function `read_unicode_string_no_cch` doesn't need a mutable reference
--> src/xls.rs:311:29
|
311 | ... &mut encoding,
| ^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_mut_passed
warning: the function `read_unicode_string_no_cch` doesn't need a mutable reference
--> src/xls.rs:313:29
|
313 | ... &mut cch,
| ^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_mut_passed
warning: the function `parse_sst` doesn't need a mutable reference
--> src/xls.rs:329:59
|
329 | 0x00FC => strings = parse_sst(&mut r, &mut encoding)?, // SST
| ^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_mut_passed
= note: `#[warn(clippy::unnecessary_mut_passed)]` on by default
warning: the function `parse_string` doesn't need a mutable reference
--> src/xls.rs:396:73
|
396 | let val = DataType::String(parse_string(r.data, &mut encoding)?);
| ^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_mut_passed
warning: the function `parse_formula` doesn't need a mutable reference
--> src/xls.rs:425:29
|
425 | ... &mut encoding,
| ^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_mut_passed
warning: the function `read_unicode_string_no_cch` doesn't need a mutable reference
--> src/xls.rs:1104:66
|
1104 | read_unicode_string_no_cch(encoding, &rgce[1..], &mut cch, &mut formula);
| ^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_mut_passed
warning: this argument is a mutable reference, but not used mutably
--> src/xls.rs:704:44
|
704 | fn parse_sst(r: &mut Record<'_>, encoding: &mut XlsEncoding) -> Result<Vec<String>, XlsError> {
| ^^^^^^^^^^^^^^^^ help: consider changing to: `&XlsEncoding`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_ref_mut
= note: `#[warn(clippy::needless_pass_by_ref_mut)]` on by default
Collaborator
Author
|
Hi @tafia , This feature has been stable since Rust 1.62. Do you need calamine to work on 1.60 for a particular reason? Any chance we can bump the MSRV to 1.62.0, and while we're at it, maybe even bump the edition to 2021? |
Owner
|
No particular strong reason. You can move it to 1.62. |
Owner
|
I'm afraid there is now a conflict though due to older PR being merged. Could you fix it? |
warning: this `impl` can be derived
--> src/datatype.rs:42:1
|
42 | / impl Default for DataType {
43 | | fn default() -> DataType {
44 | | DataType::Empty
45 | | }
46 | | }
| |_^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls
= note: `#[warn(clippy::derivable_impls)]` on by default
= help: remove the manual implementation...
help: ...and instead derive it...
|
19 + #[derive(Default)]
20 | pub enum DataType {
|
help: ...and mark the default variant
|
39 ~ #[default]
40 ~ Empty,
Collaborator
Author
|
Hi @tafia , I also went ahead and derived Default for DataType now that we're using 1.62.1. |
is-terminal is a dependency of env-logger
Owner
|
Awesome thanks! |
This file contains hidden or 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
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.
bump dependencies and apply select clippy lint suggestions