Skip to content

Added more documentation and added one test

5bcf10f
Select commit
Loading
Failed to load commit list.
Sign in for the full log view
Merged

Added more documentation #140

Added more documentation and added one test
5bcf10f
Select commit
Loading
Failed to load commit list.
GitHub Actions / clippy succeeded May 27, 2025 in 6s

clippy

348 warnings

Details

Results

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

Versions

  • rustc 1.87.0 (17067e9ac 2025-05-09)
  • cargo 1.87.0 (99624be96 2025-05-06)
  • clippy 0.1.87 (17067e9ac6 2025-05-09)

Annotations

Check warning on line 280 in src/driver/transaction.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

for loop over a `Result`. This is more readably written as an `if let` statement

warning: for loop over a `Result`. This is more readably written as an `if let` statement
   --> src/driver/transaction.rs:280:41
    |
280 |                     for single_query in queries.into_bound(gil).iter() {
    |                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: `#[warn(for_loops_over_fallibles)]` on by default
help: to check pattern in a loop use `while let`
    |
280 -                     for single_query in queries.into_bound(gil).iter() {
280 +                     while let Ok(single_query) = queries.into_bound(gil).iter() {
    |
help: consider unwrapping the `Result` with `?` to iterate over its contents
    |
280 |                     for single_query in queries.into_bound(gil).iter()? {
    |                                                                       +
help: consider using `if let` to clear intent
    |
280 -                     for single_query in queries.into_bound(gil).iter() {
280 +                     if let Ok(single_query) = queries.into_bound(gil).iter() {
    |

Check warning on line 14 in src/value_converter/consts.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this type has been superceded by `LazyLock` in the standard library

warning: this type has been superceded by `LazyLock` in the standard library
  --> src/value_converter/consts.rs:14:33
   |
14 | pub static KWARGS_QUERYSTRINGS: Lazy<RwLock<HashMap<String, (String, Vec<String>)>>> =
   |                                 ^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_std_lazy_statics
help: use `std::sync::LazyLock` instead
   |
14 ~ pub static KWARGS_QUERYSTRINGS: std::sync::LazyLock<RwLock<HashMap<String, (String, Vec<String>)>>> =
15 ~     std::sync::LazyLock::new(|| RwLock::new(Default::default()));
   |

Check warning on line 57 in src/statement/cache.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this type has been superceded by `LazyLock` in the standard library

warning: this type has been superceded by `LazyLock` in the standard library
  --> src/statement/cache.rs:57:32
   |
57 | pub(crate) static STMTS_CACHE: Lazy<RwLock<StatementsCache>> =
   |                                ^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_std_lazy_statics
   = note: `-W clippy::non-std-lazy-statics` implied by `-W clippy::pedantic`
   = help: to override `-W clippy::pedantic` add `#[allow(clippy::non_std_lazy_statics)]`
help: use `std::sync::LazyLock` instead
   |
57 ~ pub(crate) static STMTS_CACHE: std::sync::LazyLock<RwLock<StatementsCache>> =
58 ~     std::sync::LazyLock::new(|| RwLock::new(Default::default()));
   |

Check warning on line 123 in src/statement/statement_builder.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unused `async` for function with no await statements

warning: unused `async` for function with no await statements
   --> src/statement/statement_builder.rs:116:5
    |
116 | /     async fn write_to_cache(
117 | |         &self,
118 | |         mut cache_guard: RwLockWriteGuard<'_, StatementsCache>,
119 | |         query: &QueryString,
...   |
122 | |         cache_guard.add_cache(query, inner_stmt);
123 | |     }
    | |_____^
    |
    = help: consider removing the `async` from this function
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_async

Check warning on line 243 in src/driver/listener/core.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unused `async` for function with no await statements

warning: unused `async` for function with no await statements
   --> src/driver/listener/core.rs:237:5
    |
237 | /     async fn shutdown(&mut self) {
238 | |         self.abort_listen();
239 | |         std::mem::take(&mut self.connection);
240 | |         std::mem::take(&mut self.receiver);
241 | |
242 | |         self.is_started = false;
243 | |     }
    | |_____^
    |
    = help: consider removing the `async` from this function
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_async

Check warning on line 155 in src/driver/cursor.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unused `async` for function with no await statements

warning: unused `async` for function with no await statements
   --> src/driver/cursor.rs:136:5
    |
136 | /     async fn __aexit__<'a>(
137 | |         &mut self,
138 | |         _exception_type: Py<PyAny>,
139 | |         exception: Py<PyAny>,
...   |
154 | |         Ok(())
155 | |     }
    | |_____^
    |
    = help: consider removing the `async` from this function
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_async
    = note: `-W clippy::unused-async` implied by `-W clippy::pedantic`
    = help: to override `-W clippy::pedantic` add `#[allow(clippy::unused_async)]`

Check warning on line 16 in src/value_converter/traits.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

docs for function returning `Result` missing `# Errors` section

warning: docs for function returning `Result` missing `# Errors` section
  --> src/value_converter/traits.rs:13:5
   |
13 | /     fn to_python_dto(
14 | |         python_param: &pyo3::Bound<'_, PyAny>,
15 | |         array_type_: Type,
16 | |     ) -> PSQLPyResult<PythonDTO>;
   | |_________________________________^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc

Check warning on line 9 in src/value_converter/traits.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

docs for function returning `Result` missing `# Errors` section

warning: docs for function returning `Result` missing `# Errors` section
 --> src/value_converter/traits.rs:9:5
  |
9 |     fn to_python_dto(python_param: &pyo3::Bound<'_, PyAny>) -> PSQLPyResult<PythonDTO>;
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc

Check warning on line 143 in src/value_converter/to_python.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unnecessary semicolon

warning: unnecessary semicolon
   --> src/value_converter/to_python.rs:143:22
    |
143 |                     };
    |                      ^ help: remove
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_semicolon

Check warning on line 166 in src/value_converter/models/serde_value.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unnecessary semicolon

warning: unnecessary semicolon
   --> src/value_converter/models/serde_value.rs:166:22
    |
166 |                     };
    |                      ^ help: remove
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_semicolon

Check warning on line 125 in src/value_converter/models/serde_value.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

docs for function returning `Result` missing `# Errors` section

warning: docs for function returning `Result` missing `# Errors` section
   --> src/value_converter/models/serde_value.rs:125:1
    |
125 | pub fn pythondto_array_to_serde(array: Option<Array<PythonDTO>>) -> PSQLPyResult<Value> {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc

Check warning on line 111 in src/value_converter/models/serde_value.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unneeded `return` statement

warning: unneeded `return` statement
   --> src/value_converter/models/serde_value.rs:111:13
    |
111 |             return serde_value_from_list(gil, value);
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
    |
111 -             return serde_value_from_list(gil, value);
111 +             serde_value_from_list(gil, value)
    |

Check warning on line 100 in src/value_converter/models/serde_value.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unneeded `return` statement

warning: unneeded `return` statement
   --> src/value_converter/models/serde_value.rs:100:5
    |
100 |     return Ok(Value::Object(serde_map));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
    |
100 -     return Ok(Value::Object(serde_map));
100 +     Ok(Value::Object(serde_map))
    |

Check warning on line 786 in src/value_converter/from_python.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unnecessary semicolon

warning: unnecessary semicolon
   --> src/value_converter/from_python.rs:786:6
    |
786 |     };
    |      ^ help: remove
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_semicolon

Check warning on line 747 in src/value_converter/from_python.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unnecessary semicolon

warning: unnecessary semicolon
   --> src/value_converter/from_python.rs:747:10
    |
747 |         };
    |          ^ help: remove
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_semicolon

Check warning on line 738 in src/value_converter/from_python.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unnecessary semicolon

warning: unnecessary semicolon
   --> src/value_converter/from_python.rs:738:10
    |
738 |         };
    |          ^ help: remove
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_semicolon

Check warning on line 696 in src/value_converter/from_python.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unnecessary semicolon

warning: unnecessary semicolon
   --> src/value_converter/from_python.rs:696:10
    |
696 |         };
    |          ^ help: remove
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_semicolon

Check warning on line 630 in src/value_converter/from_python.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unnecessary semicolon

warning: unnecessary semicolon
   --> src/value_converter/from_python.rs:630:14
    |
630 |             };
    |              ^ help: remove
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_semicolon

Check warning on line 431 in src/value_converter/from_python.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

useless use of `format!`

warning: useless use of `format!`
   --> src/value_converter/from_python.rs:429:59
    |
429 |       Err(RustPSQLDriverError::PyToRustValueConversionError(format!(
    |  ___________________________________________________________^
430 | |         "Cannot convert parameter in extra types Array",
431 | |     )))
    | |_____^ help: consider using `.to_string()`: `"Cannot convert parameter in extra types Array".to_string()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format
    = note: `-W clippy::useless-format` implied by `-W clippy::all`
    = help: to override `-W clippy::all` add `#[allow(clippy::useless_format)]`

Check warning on line 3 in src/value_converter/dto/funcs.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function could have a `#[must_use]` attribute

warning: this function could have a `#[must_use]` attribute
 --> src/value_converter/dto/funcs.rs:3:1
  |
3 | pub fn array_type_to_single_type(array_type: &Type) -> Type {
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn array_type_to_single_type(array_type: &Type) -> Type`
  |
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate

Check warning on line 92 in src/value_converter/dto/converter_impls.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unneeded `return` statement

warning: unneeded `return` statement
  --> src/value_converter/dto/converter_impls.rs:92:9
   |
92 |         return Ok(PythonDTO::PyJsonb(serde_value));
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
   |
92 -         return Ok(PythonDTO::PyJsonb(serde_value));
92 +         Ok(PythonDTO::PyJsonb(serde_value))
   |

Check warning on line 84 in src/value_converter/dto/converter_impls.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unneeded `return` statement

warning: unneeded `return` statement
  --> src/value_converter/dto/converter_impls.rs:82:9
   |
82 | /         return Err(RustPSQLDriverError::PyToRustValueConversionError(
83 | |             "Cannot convert timedelta from Python to inner Rust type.".to_string(),
84 | |         ));
   | |__________^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
   |
82 ~         Err(RustPSQLDriverError::PyToRustValueConversionError(
83 +             "Cannot convert timedelta from Python to inner Rust type.".to_string(),
84 ~         ))
   |

Check warning on line 72 in src/value_converter/dto/converter_impls.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unneeded `return` statement

warning: unneeded `return` statement
  --> src/value_converter/dto/converter_impls.rs:70:9
   |
70 | /         return Err(RustPSQLDriverError::PyToRustValueConversionError(
71 | |             "Can not convert you datetime to rust type".into(),
72 | |         ));
   | |__________^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
   |
70 ~         Err(RustPSQLDriverError::PyToRustValueConversionError(
71 +             "Can not convert you datetime to rust type".into(),
72 ~         ))
   |

Check warning on line 26 in src/value_converter/consts.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

docs for function returning `Result` missing `# Errors` section

warning: docs for function returning `Result` missing `# Errors` section
  --> src/value_converter/consts.rs:26:1
   |
26 | pub fn get_timedelta_cls(py: Python<'_>) -> PyResult<&Bound<'_, PyType>> {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc

Check warning on line 17 in src/value_converter/consts.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

docs for function returning `Result` missing `# Errors` section

warning: docs for function returning `Result` missing `# Errors` section
  --> src/value_converter/consts.rs:17:1
   |
17 | pub fn get_decimal_cls(py: Python<'_>) -> PyResult<&Bound<'_, PyType>> {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc