chore: clippy fixes + tests for zero-length encoding of varlen columns #452
clippy
13 warnings
Details
Results
Message level | Amount |
---|---|
Internal compiler error | 0 |
Error | 0 |
Warning | 13 |
Note | 0 |
Help | 0 |
Versions
- rustc 1.77.2 (25ef9e3d8 2024-04-09)
- cargo 1.77.2 (e52e36006 2024-03-26)
- clippy 0.1.77 (25ef9e3 2024-04-09)
Annotations
Check warning on line 30 in src/tds/time.rs
github-actions / clippy
module has the same name as its containing module
warning: module has the same name as its containing module
--> src/tds/time.rs:30:1
|
30 | pub mod time;
| ^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_inception
= note: `#[warn(clippy::module_inception)]` on by default
Check warning on line 38 in src/tds/context.rs
github-actions / clippy
this call to `as_ref.map(...)` does nothing
warning: this call to `as_ref.map(...)` does nothing
--> src/tds/context.rs:38:9
|
38 | self.last_meta.as_ref().map(Arc::clone)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `self.last_meta.clone()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_asref
= note: `#[warn(clippy::useless_asref)]` on by default
Check warning on line 9 in src/tds/collation.rs
github-actions / clippy
this is an outer doc comment and does not apply to the parent module or crate
warning: this is an outer doc comment and does not apply to the parent module or crate
--> src/tds/collation.rs:3:1
|
3 | / ///! legacy implementation of collations (or codepages rather) for dealing with varchar's with legacy databases
4 | | ///! references [1] which has some mappings from the katmai (SQL Server 2008) source code and is a TDS driver
5 | | ///! directly from microsoft
6 | | ///! [2] is helpful to map CP1234 to the appropriate encoding
7 | | ///!
8 | | ///! [1] https://github.com/Microsoft/mssql-jdbc/blob/eb14f63077c47ef1fc1c690deb8cfab602baeb85/src/main/java/com/microsoft/sqlserver/jdbc...
9 | | ///! [2] https://github.com/lifthrasiir/rust-encoding/blob/496823171f15d9b9446b2ec3fb7765f22346256b/src/label.rs#L282
| |_____________________________________________________________________________________________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_doc_comments
= note: `#[warn(clippy::suspicious_doc_comments)]` on by default
help: use an inner doc comment to document the parent module or crate
|
3 + //! legacy implementation of collations (or codepages rather) for dealing with varchar's with legacy databases
4 + //! references [1] which has some mappings from the katmai (SQL Server 2008) source code and is a TDS driver
5 + //! directly from microsoft
6 + //! [2] is helpful to map CP1234 to the appropriate encoding
7 + //!
8 + //! [1] https://github.com/Microsoft/mssql-jdbc/blob/eb14f63077c47ef1fc1c690deb8cfab602baeb85/src/main/java/com/microsoft/sqlserver/jdbc/SQLCollation.java
9 + //! [2] https://github.com/lifthrasiir/rust-encoding/blob/496823171f15d9b9446b2ec3fb7765f22346256b/src/label.rs#L282
|
Check warning on line 274 in src/tds/codec/type_info.rs
github-actions / clippy
redundant guard
warning: redundant guard
--> src/tds/codec/type_info.rs:274:23
|
274 | Ok(ty) if ty == VarLenType::Xml => {
| ^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_guards
= note: `#[warn(clippy::redundant_guards)]` on by default
help: try
|
274 - Ok(ty) if ty == VarLenType::Xml => {
274 + Ok(VarLenType::Xml) => {
|
Check warning on line 344 in src/tds/codec/column_data.rs
github-actions / clippy
length comparison to zero
warning: length comparison to zero
--> src/tds/codec/column_data.rs:344:28
|
344 | if bytes.len() > 0 {
| ^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!bytes.is_empty()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero
= note: `#[warn(clippy::len_zero)]` on by default
Check warning on line 296 in src/client/connection.rs
github-actions / clippy
this function has too many arguments (8/7)
warning: this function has too many arguments (8/7)
--> src/client/connection.rs:287:5
|
287 | / async fn login<'a>(
288 | | mut self,
289 | | auth: AuthMethod,
290 | | encryption: EncryptionLevel,
... |
295 | | prelogin: PreloginMessage,
296 | | ) -> crate::Result<Self> {
| |____________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
= note: `#[warn(clippy::too_many_arguments)]` on by default
Check warning on line 47 in src/client/config/ado_net.rs
github-actions / clippy
useless conversion to the same type: `std::string::String`
warning: useless conversion to the same type: `std::string::String`
--> src/client/config/ado_net.rs:47:32
|
47 | host: Some(parts[0].replace("(local)", "localhost").into()),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `parts[0].replace("(local)", "localhost")`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
Check warning on line 40 in src/client/config/ado_net.rs
github-actions / clippy
useless conversion to the same type: `std::string::String`
warning: useless conversion to the same type: `std::string::String`
--> src/client/config/ado_net.rs:40:32
|
40 | host: Some(parts[0].replace("(local)", "localhost").into()),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `parts[0].replace("(local)", "localhost")`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
= note: `#[warn(clippy::useless_conversion)]` on by default
Check warning on line 94 in src/tds/time/chrono.rs
github-actions / clippy
use of deprecated associated function `chrono::DateTime::<Tz>::from_utc`: Use TimeZone::from_utc_datetime() or DateTime::from_naive_utc_and_offset instead
warning: use of deprecated associated function `chrono::DateTime::<Tz>::from_utc`: Use TimeZone::from_utc_datetime() or DateTime::from_naive_utc_and_offset instead
--> src/tds/time/chrono.rs:94:27
|
94 | chrono::DateTime::from_utc(naive, offset)
| ^^^^^^^^
Check warning on line 94 in src/tds/time/chrono.rs
github-actions / clippy
use of deprecated associated function `chrono::DateTime::<Tz>::from_utc`: Use TimeZone::from_utc_datetime() or DateTime::from_naive_utc_and_offset instead
warning: use of deprecated associated function `chrono::DateTime::<Tz>::from_utc`: Use TimeZone::from_utc_datetime() or DateTime::from_naive_utc_and_offset instead
--> src/tds/time/chrono.rs:94:27
|
94 | chrono::DateTime::from_utc(naive, offset)
| ^^^^^^^^
Check warning on line 84 in src/tds/time/chrono.rs
github-actions / clippy
use of deprecated associated function `chrono::DateTime::<Tz>::from_utc`: Use TimeZone::from_utc_datetime() or DateTime::from_naive_utc_and_offset instead
warning: use of deprecated associated function `chrono::DateTime::<Tz>::from_utc`: Use TimeZone::from_utc_datetime() or DateTime::from_naive_utc_and_offset instead
--> src/tds/time/chrono.rs:84:31
|
84 | chrono::DateTime::from_utc(naive, Utc)
| ^^^^^^^^
Check warning on line 84 in src/tds/time/chrono.rs
github-actions / clippy
use of deprecated associated function `chrono::DateTime::<Tz>::from_utc`: Use TimeZone::from_utc_datetime() or DateTime::from_naive_utc_and_offset instead
warning: use of deprecated associated function `chrono::DateTime::<Tz>::from_utc`: Use TimeZone::from_utc_datetime() or DateTime::from_naive_utc_and_offset instead
--> src/tds/time/chrono.rs:84:31
|
84 | chrono::DateTime::from_utc(naive, Utc)
| ^^^^^^^^
|
= note: `#[warn(deprecated)]` on by default
Check warning on line 10 in src/tds/time/time.rs
github-actions / clippy
private item shadows public glob re-export
warning: private item shadows public glob re-export
--> src/tds/time/time.rs:10:5
|
10 | use std::time::Duration;
| ^^^^^^^^^^^^^^^^^^^
|
note: the name `Duration` in the type namespace is supposed to be publicly re-exported here
--> src/tds/time/time.rs:7:9
|
7 | pub use time::*;
| ^^^^^^^
note: but the private item here shadows it
--> src/tds/time/time.rs:10:5
|
10 | use std::time::Duration;
| ^^^^^^^^^^^^^^^^^^^
= note: `#[warn(hidden_glob_reexports)]` on by default