diff --git a/rust/src/python/helpers.rs b/rust/src/python/helpers.rs index f4523426..eb2ffe8b 100644 --- a/rust/src/python/helpers.rs +++ b/rust/src/python/helpers.rs @@ -1,3 +1,4 @@ +#![allow(clippy::useless_conversion)] use std::cmp::Ordering; use pyo3::{ @@ -123,23 +124,23 @@ pub fn get_offset(dt: &Bound) -> PyResult { } #[pyfunction] -pub fn is_leap(year: i32) -> PyResult { - 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 { - 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 { - 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 { - Ok(helpers::days_in_year(year)) +pub fn days_in_year(year: i32) -> u32 { + helpers::days_in_year(year) } #[pyfunction] @@ -147,8 +148,8 @@ 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] diff --git a/rust/src/python/parsing.rs b/rust/src/python/parsing.rs index cff608e5..61e0ad16 100644 --- a/rust/src/python/parsing.rs +++ b/rust/src/python/parsing.rs @@ -1,3 +1,4 @@ +#![allow(clippy::useless_conversion)] use pyo3::exceptions; use pyo3::prelude::*; use pyo3::types::PyDate; diff --git a/rust/src/python/types/timezone.rs b/rust/src/python/types/timezone.rs index 58012710..9d12f836 100644 --- a/rust/src/python/types/timezone.rs +++ b/rust/src/python/types/timezone.rs @@ -1,3 +1,4 @@ +#![allow(clippy::useless_conversion)] use pyo3::prelude::*; use pyo3::types::{PyDelta, PyDict, PyTzInfo};