Skip to content

Commit 5571f84

Browse files
committed
Changed lints
Signed-off-by: chandr-andr (Kiselev Aleksandr) <chandr@chandr.net>
1 parent cef8943 commit 5571f84

File tree

5 files changed

+96
-117
lines changed

5 files changed

+96
-117
lines changed

.github/workflows/test.yaml

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,6 @@ on:
44
pull_request:
55

66
jobs:
7-
py-lint:
8-
strategy:
9-
matrix:
10-
cmd:
11-
- mypy
12-
runs-on: ubuntu-latest
13-
steps:
14-
- uses: actions/checkout@v2
15-
- name: Set up Python
16-
uses: actions/setup-python@v4
17-
with:
18-
python-version: "3.12"
19-
- name: Run lint check
20-
uses: pre-commit/action@v3.0.0
21-
with:
22-
extra_args: -a ${{ matrix.cmd }}
237
fmt:
248
runs-on: ubuntu-latest
259
steps:

src/additional_types.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -114,15 +114,15 @@ impl ToPyObject for Circle {
114114
}
115115
}
116116

117-
impl<'a> IntoPy<PyObject> for &'a RustPoint {
117+
impl IntoPy<PyObject> for &RustPoint {
118118
#[inline]
119119
fn into_py(self, py: Python<'_>) -> PyObject {
120120
let inner_value = self.inner();
121-
return PyTuple::new_bound(
121+
PyTuple::new_bound(
122122
py,
123123
vec![inner_value.x().into_py(py), inner_value.y().into_py(py)],
124124
)
125-
.into();
125+
.into()
126126
}
127127
}
128128

@@ -157,7 +157,7 @@ impl<'a> FromSql<'a> for RustPoint {
157157
}
158158
}
159159

160-
impl<'a> IntoPy<PyObject> for &'a RustRect {
160+
impl IntoPy<PyObject> for &RustRect {
161161
#[inline]
162162
fn into_py(self, py: Python<'_>) -> PyObject {
163163
let inner_value = self.inner();
@@ -173,7 +173,7 @@ impl<'a> IntoPy<PyObject> for &'a RustRect {
173173
.into(),
174174
);
175175
}
176-
return PyTuple::new_bound(py, result_vec).into();
176+
PyTuple::new_bound(py, result_vec).into()
177177
}
178178
}
179179

@@ -208,7 +208,7 @@ impl<'a> FromSql<'a> for RustRect {
208208
}
209209
}
210210

211-
impl<'a> IntoPy<PyObject> for &'a RustLineString {
211+
impl IntoPy<PyObject> for &RustLineString {
212212
#[inline]
213213
fn into_py(self, py: Python<'_>) -> PyObject {
214214
let inner_value = self.inner();
@@ -224,7 +224,7 @@ impl<'a> IntoPy<PyObject> for &'a RustLineString {
224224
if inner_value.is_closed() {
225225
return PyTuple::new_bound(py, result_vec).into();
226226
}
227-
return PyList::new_bound(py, result_vec).into();
227+
PyList::new_bound(py, result_vec).into()
228228
}
229229
}
230230

@@ -259,7 +259,7 @@ impl<'a> FromSql<'a> for RustLineString {
259259
}
260260
}
261261

262-
impl<'a> IntoPy<PyObject> for &'a RustLineSegment {
262+
impl IntoPy<PyObject> for &RustLineSegment {
263263
#[inline]
264264
fn into_py(self, py: Python<'_>) -> PyObject {
265265
let inner_value = self.inner();
@@ -272,7 +272,7 @@ impl<'a> IntoPy<PyObject> for &'a RustLineSegment {
272272
);
273273
}
274274

275-
return PyList::new_bound(py, result_vec).into();
275+
PyList::new_bound(py, result_vec).into()
276276
}
277277
}
278278

@@ -445,7 +445,7 @@ impl<T: CoordNum> DivAssign<T> for Line<T> {
445445
}
446446
}
447447

448-
impl<'a> IntoPy<PyObject> for &'a Line {
448+
impl IntoPy<PyObject> for &Line {
449449
#[inline]
450450
fn into_py(self, py: Python<'_>) -> PyObject {
451451
let result_vec: Vec<Py<PyAny>> = vec![
@@ -454,7 +454,7 @@ impl<'a> IntoPy<PyObject> for &'a Line {
454454
self.c().into_py(py),
455455
];
456456

457-
return PyTuple::new_bound(py, result_vec).into();
457+
PyTuple::new_bound(py, result_vec).into()
458458
}
459459
}
460460

@@ -563,7 +563,7 @@ impl<T: CoordFloat> Circle<T> {
563563
}
564564
}
565565

566-
impl<'a> IntoPy<PyObject> for &'a Circle {
566+
impl IntoPy<PyObject> for &Circle {
567567
#[inline]
568568
fn into_py(self, py: Python<'_>) -> PyObject {
569569
let center = self.center();
@@ -573,7 +573,7 @@ impl<'a> IntoPy<PyObject> for &'a Circle {
573573
self.radius().into_py(py),
574574
];
575575

576-
return PyTuple::new_bound(py, result_vec).into();
576+
PyTuple::new_bound(py, result_vec).into()
577577
}
578578
}
579579

src/driver/cursor.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ use crate::{
1313
};
1414

1515
/// Additional implementation for the `Object` type.
16+
#[allow(clippy::ref_option)]
1617
trait CursorObjectTrait {
1718
async fn cursor_start(
1819
&self,
@@ -33,6 +34,7 @@ impl CursorObjectTrait for Object {
3334
///
3435
/// # Errors
3536
/// May return Err Result if cannot execute querystring.
37+
#[allow(clippy::ref_option)]
3638
async fn cursor_start(
3739
&self,
3840
cursor_name: &str,

src/query_result.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ use crate::{exceptions::rust_errors::RustPSQLDriverPyResult, value_converter::po
1010
/// May return Err Result if can not convert
1111
/// postgres type to python or set new key-value pair
1212
/// in python dict.
13+
#[allow(clippy::ref_option)]
1314
fn row_to_dict<'a>(
1415
py: Python<'a>,
1516
postgres_row: &'a Row,

0 commit comments

Comments
 (0)