Skip to content

Commit

Permalink
Changed lints
Browse files Browse the repository at this point in the history
Signed-off-by: chandr-andr (Kiselev Aleksandr) <[email protected]>
  • Loading branch information
chandr-andr committed Dec 2, 2024
1 parent cef8943 commit 5571f84
Show file tree
Hide file tree
Showing 5 changed files with 96 additions and 117 deletions.
16 changes: 0 additions & 16 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,6 @@ on:
pull_request:

jobs:
py-lint:
strategy:
matrix:
cmd:
- mypy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.12"
- name: Run lint check
uses: pre-commit/[email protected]
with:
extra_args: -a ${{ matrix.cmd }}
fmt:
runs-on: ubuntu-latest
steps:
Expand Down
26 changes: 13 additions & 13 deletions src/additional_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,15 @@ impl ToPyObject for Circle {
}
}

impl<'a> IntoPy<PyObject> for &'a RustPoint {
impl IntoPy<PyObject> for &RustPoint {
#[inline]
fn into_py(self, py: Python<'_>) -> PyObject {
let inner_value = self.inner();
return PyTuple::new_bound(
PyTuple::new_bound(
py,
vec![inner_value.x().into_py(py), inner_value.y().into_py(py)],
)
.into();
.into()
}
}

Expand Down Expand Up @@ -157,7 +157,7 @@ impl<'a> FromSql<'a> for RustPoint {
}
}

impl<'a> IntoPy<PyObject> for &'a RustRect {
impl IntoPy<PyObject> for &RustRect {
#[inline]
fn into_py(self, py: Python<'_>) -> PyObject {
let inner_value = self.inner();
Expand All @@ -173,7 +173,7 @@ impl<'a> IntoPy<PyObject> for &'a RustRect {
.into(),
);
}
return PyTuple::new_bound(py, result_vec).into();
PyTuple::new_bound(py, result_vec).into()
}
}

Expand Down Expand Up @@ -208,7 +208,7 @@ impl<'a> FromSql<'a> for RustRect {
}
}

impl<'a> IntoPy<PyObject> for &'a RustLineString {
impl IntoPy<PyObject> for &RustLineString {
#[inline]
fn into_py(self, py: Python<'_>) -> PyObject {
let inner_value = self.inner();
Expand All @@ -224,7 +224,7 @@ impl<'a> IntoPy<PyObject> for &'a RustLineString {
if inner_value.is_closed() {
return PyTuple::new_bound(py, result_vec).into();
}
return PyList::new_bound(py, result_vec).into();
PyList::new_bound(py, result_vec).into()
}
}

Expand Down Expand Up @@ -259,7 +259,7 @@ impl<'a> FromSql<'a> for RustLineString {
}
}

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

return PyList::new_bound(py, result_vec).into();
PyList::new_bound(py, result_vec).into()
}
}

Expand Down Expand Up @@ -445,7 +445,7 @@ impl<T: CoordNum> DivAssign<T> for Line<T> {
}
}

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

return PyTuple::new_bound(py, result_vec).into();
PyTuple::new_bound(py, result_vec).into()
}
}

Expand Down Expand Up @@ -563,7 +563,7 @@ impl<T: CoordFloat> Circle<T> {
}
}

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

return PyTuple::new_bound(py, result_vec).into();
PyTuple::new_bound(py, result_vec).into()
}
}

Expand Down
2 changes: 2 additions & 0 deletions src/driver/cursor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ use crate::{
};

/// Additional implementation for the `Object` type.
#[allow(clippy::ref_option)]
trait CursorObjectTrait {
async fn cursor_start(
&self,
Expand All @@ -33,6 +34,7 @@ impl CursorObjectTrait for Object {
///
/// # Errors
/// May return Err Result if cannot execute querystring.
#[allow(clippy::ref_option)]
async fn cursor_start(
&self,
cursor_name: &str,
Expand Down
1 change: 1 addition & 0 deletions src/query_result.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use crate::{exceptions::rust_errors::RustPSQLDriverPyResult, value_converter::po
/// May return Err Result if can not convert
/// postgres type to python or set new key-value pair
/// in python dict.
#[allow(clippy::ref_option)]
fn row_to_dict<'a>(
py: Python<'a>,
postgres_row: &'a Row,
Expand Down
Loading

0 comments on commit 5571f84

Please sign in to comment.