|
| 1 | +#![allow(clippy::useless_conversion)] |
1 | 2 | use std::cmp::Ordering; |
2 | 3 |
|
3 | 4 | use pyo3::{ |
@@ -123,32 +124,32 @@ pub fn get_offset(dt: &Bound<PyAny>) -> PyResult<i32> { |
123 | 124 | } |
124 | 125 |
|
125 | 126 | #[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) |
128 | 129 | } |
129 | 130 |
|
130 | 131 | #[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) |
133 | 134 | } |
134 | 135 |
|
135 | 136 | #[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) |
138 | 139 | } |
139 | 140 |
|
140 | 141 | #[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) |
143 | 144 | } |
144 | 145 |
|
145 | 146 | #[pyfunction] |
146 | 147 | pub fn local_time( |
147 | 148 | unix_time: f64, |
148 | 149 | utc_offset: isize, |
149 | 150 | 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) |
152 | 153 | } |
153 | 154 |
|
154 | 155 | #[pyfunction] |
|
0 commit comments