Skip to content

Fix and silence clippy errors #884

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 11 additions & 10 deletions rust/src/python/helpers.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(clippy::useless_conversion)]
use std::cmp::Ordering;

use pyo3::{
Expand Down Expand Up @@ -123,32 +124,32 @@ pub fn get_offset(dt: &Bound<PyAny>) -> PyResult<i32> {
}

#[pyfunction]
pub fn is_leap(year: i32) -> PyResult<bool> {
Ok(helpers::is_leap(year))
pub fn is_leap(year: i32) -> bool {
helpers::is_leap(year)
}

#[pyfunction]
pub fn is_long_year(year: i32) -> PyResult<bool> {
Ok(helpers::is_long_year(year))
pub fn is_long_year(year: i32) -> bool {
helpers::is_long_year(year)
}

#[pyfunction]
pub fn week_day(year: i32, month: u32, day: u32) -> PyResult<u32> {
Ok(helpers::week_day(year, month, day))
pub fn week_day(year: i32, month: u32, day: u32) -> u32 {
helpers::week_day(year, month, day)
}

#[pyfunction]
pub fn days_in_year(year: i32) -> PyResult<u32> {
Ok(helpers::days_in_year(year))
pub fn days_in_year(year: i32) -> u32 {
helpers::days_in_year(year)
}

#[pyfunction]
pub fn local_time(
unix_time: f64,
utc_offset: isize,
microsecond: usize,
) -> PyResult<(usize, usize, usize, usize, usize, usize, usize)> {
Ok(helpers::local_time(unix_time, utc_offset, microsecond))
) -> (usize, usize, usize, usize, usize, usize, usize) {
helpers::local_time(unix_time, utc_offset, microsecond)
}

#[pyfunction]
Expand Down
1 change: 1 addition & 0 deletions rust/src/python/parsing.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(clippy::useless_conversion)]
use pyo3::exceptions;
use pyo3::prelude::*;
use pyo3::types::PyDate;
Expand Down
1 change: 1 addition & 0 deletions rust/src/python/types/timezone.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(clippy::useless_conversion)]
use pyo3::prelude::*;
use pyo3::types::{PyDelta, PyDict, PyTzInfo};

Expand Down
Loading