Skip to content

fix: improve column type info #478

fix: improve column type info

fix: improve column type info #478

GitHub Actions / clippy succeeded Jul 17, 2024 in 0s

clippy

26 warnings

Details

Results

Message level Amount
Internal compiler error 0
Error 0
Warning 26
Note 0
Help 0

Versions

  • rustc 1.79.0 (129f3b996 2024-06-10)
  • cargo 1.79.0 (ffa9cf99a 2024-06-03)
  • clippy 0.1.79 (129f3b9 2024-06-10)

Annotations

Check warning on line 30 in src/tds/time.rs

See this annotation in the file changed.

@github-actions 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 115 in src/tds/numeric.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

usage of a legacy numeric method

warning: usage of a legacy numeric method
   --> src/tds/numeric.rs:115:47
    |
115 |             let high_part = high_part * (u64::max_value() as u128 + 1);
    |                                               ^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
help: use the associated constant instead
    |
115 |             let high_part = high_part * (u64::MAX as u128 + 1);
    |                                               ~~~

Check warning on line 5 in src/tds/codec/type_info.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

importing legacy numeric constants

warning: importing legacy numeric constants
 --> src/tds/codec/type_info.rs:5:40
  |
5 | use std::{convert::TryFrom, sync::Arc, usize};
  |                                        ^^^^^
  |
  = help: remove this import
  = note: then `usize::<CONST>` will resolve to the respective associated constant
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants

Check warning on line 22 in src/macros.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

casting `tds::codec::login::FeatureLevel::SqlServerN` to `u8` will truncate the value

warning: casting `tds::codec::login::FeatureLevel::SqlServerN` to `u8` will truncate the value
  --> src/macros.rs:22:39
   |
22 |                       $( x if x == $ty::$variant as u8 => Ok($ty::$variant), )*
   |                                         ^^^^^^^^^^^^^^
   |
  ::: src/tds/codec/login.rs:9:1
   |
9  | / uint_enum! {
10 | |     #[repr(u32)]
11 | |     #[derive(PartialOrd)]
12 | |     pub enum FeatureLevel {
...  |
21 | |     }
22 | | }
   | |_- in this macro invocation
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_enum_truncation
   = note: this warning originates in the macro `uint_enum` (in Nightly builds, run with -Z macro-backtrace for more info)

Check warning on line 22 in src/macros.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

casting `tds::codec::login::FeatureLevel::SqlServer2008R2` to `u8` will truncate the value

warning: casting `tds::codec::login::FeatureLevel::SqlServer2008R2` to `u8` will truncate the value
  --> src/macros.rs:22:39
   |
22 |                       $( x if x == $ty::$variant as u8 => Ok($ty::$variant), )*
   |                                         ^^^^^^^^^^^^^^
   |
  ::: src/tds/codec/login.rs:9:1
   |
9  | / uint_enum! {
10 | |     #[repr(u32)]
11 | |     #[derive(PartialOrd)]
12 | |     pub enum FeatureLevel {
...  |
21 | |     }
22 | | }
   | |_- in this macro invocation
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_enum_truncation
   = note: this warning originates in the macro `uint_enum` (in Nightly builds, run with -Z macro-backtrace for more info)

Check warning on line 22 in src/macros.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

casting `tds::codec::login::FeatureLevel::SqlServer2008` to `u8` will truncate the value

warning: casting `tds::codec::login::FeatureLevel::SqlServer2008` to `u8` will truncate the value
  --> src/macros.rs:22:39
   |
22 |                       $( x if x == $ty::$variant as u8 => Ok($ty::$variant), )*
   |                                         ^^^^^^^^^^^^^^
   |
  ::: src/tds/codec/login.rs:9:1
   |
9  | / uint_enum! {
10 | |     #[repr(u32)]
11 | |     #[derive(PartialOrd)]
12 | |     pub enum FeatureLevel {
...  |
21 | |     }
22 | | }
   | |_- in this macro invocation
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_enum_truncation
   = note: this warning originates in the macro `uint_enum` (in Nightly builds, run with -Z macro-backtrace for more info)

Check warning on line 22 in src/macros.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

casting `tds::codec::login::FeatureLevel::SqlServer2005` to `u8` will truncate the value

warning: casting `tds::codec::login::FeatureLevel::SqlServer2005` to `u8` will truncate the value
  --> src/macros.rs:22:39
   |
22 |                       $( x if x == $ty::$variant as u8 => Ok($ty::$variant), )*
   |                                         ^^^^^^^^^^^^^^
   |
  ::: src/tds/codec/login.rs:9:1
   |
9  | / uint_enum! {
10 | |     #[repr(u32)]
11 | |     #[derive(PartialOrd)]
12 | |     pub enum FeatureLevel {
...  |
21 | |     }
22 | | }
   | |_- in this macro invocation
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_enum_truncation
   = note: this warning originates in the macro `uint_enum` (in Nightly builds, run with -Z macro-backtrace for more info)

Check warning on line 22 in src/macros.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

casting `tds::codec::login::FeatureLevel::SqlServer2000Sp1` to `u8` will truncate the value

warning: casting `tds::codec::login::FeatureLevel::SqlServer2000Sp1` to `u8` will truncate the value
  --> src/macros.rs:22:39
   |
22 |                       $( x if x == $ty::$variant as u8 => Ok($ty::$variant), )*
   |                                         ^^^^^^^^^^^^^^
   |
  ::: src/tds/codec/login.rs:9:1
   |
9  | / uint_enum! {
10 | |     #[repr(u32)]
11 | |     #[derive(PartialOrd)]
12 | |     pub enum FeatureLevel {
...  |
21 | |     }
22 | | }
   | |_- in this macro invocation
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_enum_truncation
   = note: this warning originates in the macro `uint_enum` (in Nightly builds, run with -Z macro-backtrace for more info)

Check warning on line 22 in src/macros.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

casting `tds::codec::login::FeatureLevel::SqlServer2000` to `u8` will truncate the value

warning: casting `tds::codec::login::FeatureLevel::SqlServer2000` to `u8` will truncate the value
  --> src/macros.rs:22:39
   |
22 |                       $( x if x == $ty::$variant as u8 => Ok($ty::$variant), )*
   |                                         ^^^^^^^^^^^^^^
   |
  ::: src/tds/codec/login.rs:9:1
   |
9  | / uint_enum! {
10 | |     #[repr(u32)]
11 | |     #[derive(PartialOrd)]
12 | |     pub enum FeatureLevel {
...  |
21 | |     }
22 | | }
   | |_- in this macro invocation
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_enum_truncation
   = note: this warning originates in the macro `uint_enum` (in Nightly builds, run with -Z macro-backtrace for more info)

Check warning on line 22 in src/macros.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

casting `tds::codec::login::FeatureLevel::SqlServerV7` to `u8` will truncate the value

warning: casting `tds::codec::login::FeatureLevel::SqlServerV7` to `u8` will truncate the value
  --> src/macros.rs:22:39
   |
22 |                       $( x if x == $ty::$variant as u8 => Ok($ty::$variant), )*
   |                                         ^^^^^^^^^^^^^^
   |
  ::: src/tds/codec/login.rs:9:1
   |
9  | / uint_enum! {
10 | |     #[repr(u32)]
11 | |     #[derive(PartialOrd)]
12 | |     pub enum FeatureLevel {
...  |
21 | |     }
22 | | }
   | |_- in this macro invocation
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_enum_truncation
   = note: `#[warn(clippy::cast_enum_truncation)]` on by default
   = note: this warning originates in the macro `uint_enum` (in Nightly builds, run with -Z macro-backtrace for more info)

Check warning on line 60 in src/tds/codec/header.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

usage of a legacy numeric method

warning: usage of a legacy numeric method
  --> src/tds/codec/header.rs:60:32
   |
60 |         assert!(length <= u16::max_value() as usize);
   |                                ^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
   = note: `#[warn(clippy::legacy_numeric_constants)]` on by default
help: use the associated constant instead
   |
60 |         assert!(length <= u16::MAX as usize);
   |                                ~~~

Check warning on line 31 in src/tds/stream/token.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

field `0` is never read

warning: field `0` is never read
  --> src/tds/stream/token.rs:31:19
   |
31 |     FeatureExtAck(TokenFeatureExtAck),
   |     ------------- ^^^^^^^^^^^^^^^^^^
   |     |
   |     field in this variant
   |
help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
   |
31 |     FeatureExtAck(()),
   |                   ~~

Check warning on line 29 in src/tds/stream/token.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

field `0` is never read

warning: field `0` is never read
  --> src/tds/stream/token.rs:29:14
   |
29 |     LoginAck(TokenLoginAck),
   |     -------- ^^^^^^^^^^^^^
   |     |
   |     field in this variant
   |
help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
   |
29 |     LoginAck(()),
   |              ~~

Check warning on line 28 in src/tds/stream/token.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

field `0` is never read

warning: field `0` is never read
  --> src/tds/stream/token.rs:28:10
   |
28 |     Info(TokenInfo),
   |     ---- ^^^^^^^^^
   |     |
   |     field in this variant
   |
help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
   |
28 |     Info(()),
   |          ~~

Check warning on line 26 in src/tds/stream/token.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

field `0` is never read

warning: field `0` is never read
  --> src/tds/stream/token.rs:26:11
   |
26 |     Order(TokenOrder),
   |     ----- ^^^^^^^^^^
   |     |
   |     field in this variant
   |
help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
   |
26 |     Order(()),
   |           ~~

Check warning on line 25 in src/tds/stream/token.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

field `0` is never read

warning: field `0` is never read
  --> src/tds/stream/token.rs:25:17
   |
25 |     ReturnValue(TokenReturnValue),
   |     ----------- ^^^^^^^^^^^^^^^^
   |     |
   |     field in this variant
   |
help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
   |
25 |     ReturnValue(()),
   |                 ~~

Check warning on line 24 in src/tds/stream/token.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

field `0` is never read

warning: field `0` is never read
  --> src/tds/stream/token.rs:24:18
   |
24 |     ReturnStatus(u32),
   |     ------------ ^^^
   |     |
   |     field in this variant
   |
help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
   |
24 |     ReturnStatus(()),
   |                  ~~

Check warning on line 6 in src/tds/codec/token/token_return_value.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

fields `param_ordinal`, `param_name`, `udf`, `meta`, and `value` are never read

warning: fields `param_ordinal`, `param_name`, `udf`, `meta`, and `value` are never read
  --> src/tds/codec/token/token_return_value.rs:6:9
   |
5  | pub struct TokenReturnValue {
   |            ---------------- fields in this struct
6  |     pub param_ordinal: u16,
   |         ^^^^^^^^^^^^^
7  |     pub param_name: String,
   |         ^^^^^^^^^^
8  |     /// return value of user defined function
9  |     pub udf: bool,
   |         ^^^
10 |     pub meta: BaseMetaDataColumn,
   |         ^^^^
11 |     pub value: ColumnData<'static>,
   |         ^^^^^
   |
   = note: `TokenReturnValue` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis

Check warning on line 16 in src/tds/codec/token/token_feature_ext_ack.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

field `0` is never read

warning: field `0` is never read
  --> src/tds/codec/token/token_feature_ext_ack.rs:16:13
   |
16 |     FedAuth(FedAuthAck),
   |     ------- ^^^^^^^^^^
   |     |
   |     field in this variant
   |
help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
   |
16 |     FedAuth(()),
   |             ~~

Check warning on line 11 in src/tds/codec/token/token_feature_ext_ack.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

field `nonce` is never read

warning: field `nonce` is never read
  --> src/tds/codec/token/token_feature_ext_ack.rs:11:21
   |
11 |     SecurityToken { nonce: Option<[u8; 32]> },
   |     -------------   ^^^^^
   |     |
   |     field in this variant
   |
   = note: `#[warn(dead_code)]` on by default

Check warning on line 102 in src/tds/time/chrono.rs

See this annotation in the file changed.

@github-actions 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:102:27
    |
102 |         chrono::DateTime::from_utc(naive, offset)
    |                           ^^^^^^^^

Check warning on line 102 in src/tds/time/chrono.rs

See this annotation in the file changed.

@github-actions 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:102:27
    |
102 |         chrono::DateTime::from_utc(naive, offset)
    |                           ^^^^^^^^

Check warning on line 92 in src/tds/time/chrono.rs

See this annotation in the file changed.

@github-actions 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:92:31
   |
92 |             chrono::DateTime::from_utc(naive, Utc)
   |                               ^^^^^^^^

Check warning on line 84 in src/tds/time/chrono.rs

See this annotation in the file changed.

@github-actions 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 92 in src/tds/time/chrono.rs

See this annotation in the file changed.

@github-actions 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:92:31
   |
92 |             chrono::DateTime::from_utc(naive, Utc)
   |                               ^^^^^^^^