Skip to content

Commit 3205e97

Browse files
authored
Fix and silence clippy errors (#884)
1 parent 9f7b8cf commit 3205e97

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

Diff for: rust/src/python/helpers.rs

+11-10
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#![allow(clippy::useless_conversion)]
12
use std::cmp::Ordering;
23

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

125126
#[pyfunction]
126-
pub fn is_leap(year: i32) -> PyResult<bool> {
127-
Ok(helpers::is_leap(year))
127+
pub fn is_leap(year: i32) -> bool {
128+
helpers::is_leap(year)
128129
}
129130

130131
#[pyfunction]
131-
pub fn is_long_year(year: i32) -> PyResult<bool> {
132-
Ok(helpers::is_long_year(year))
132+
pub fn is_long_year(year: i32) -> bool {
133+
helpers::is_long_year(year)
133134
}
134135

135136
#[pyfunction]
136-
pub fn week_day(year: i32, month: u32, day: u32) -> PyResult<u32> {
137-
Ok(helpers::week_day(year, month, day))
137+
pub fn week_day(year: i32, month: u32, day: u32) -> u32 {
138+
helpers::week_day(year, month, day)
138139
}
139140

140141
#[pyfunction]
141-
pub fn days_in_year(year: i32) -> PyResult<u32> {
142-
Ok(helpers::days_in_year(year))
142+
pub fn days_in_year(year: i32) -> u32 {
143+
helpers::days_in_year(year)
143144
}
144145

145146
#[pyfunction]
146147
pub fn local_time(
147148
unix_time: f64,
148149
utc_offset: isize,
149150
microsecond: usize,
150-
) -> PyResult<(usize, usize, usize, usize, usize, usize, usize)> {
151-
Ok(helpers::local_time(unix_time, utc_offset, microsecond))
151+
) -> (usize, usize, usize, usize, usize, usize, usize) {
152+
helpers::local_time(unix_time, utc_offset, microsecond)
152153
}
153154

154155
#[pyfunction]

Diff for: rust/src/python/parsing.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#![allow(clippy::useless_conversion)]
12
use pyo3::exceptions;
23
use pyo3::prelude::*;
34
use pyo3::types::PyDate;

Diff for: rust/src/python/types/timezone.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#![allow(clippy::useless_conversion)]
12
use pyo3::prelude::*;
23
use pyo3::types::{PyDelta, PyDict, PyTzInfo};
34

0 commit comments

Comments
 (0)