@@ -3,7 +3,7 @@ use pyo3::exceptions::PyValueError;
33use pyo3:: PyTypeInfo ;
44use pyo3:: wrap_pyfunction;
55use pyo3:: types:: { PyDate , PyDateTime , PyAny , PyString , PyBool , PyBytes , PyInt , PyFloat , PyList } ;
6- use chrono:: { Datelike , Timelike , NaiveDate , NaiveDateTime , DateTime , Utc } ;
6+ use chrono:: { Datelike , Timelike , NaiveDate , NaiveDateTime , DateTime } ;
77use speedate:: Date as SpeeDate ;
88use speedate:: DateTime as SpeeDateTime ;
99use uuid:: Uuid ;
@@ -66,7 +66,7 @@ fn to_list(py: Python, py_type: Py<PyAny>, input_list: Py<PyList>) -> PyResult<P
6666 let mut result_list: Vec < PyObject > = Vec :: new ( ) ;
6767
6868 for item in input_list. iter ( ) {
69- let converted_item = Python :: with_gil ( |py | {
69+ let converted_item = Python :: with_gil ( |_py : Python < ' _ > | {
7070 let py_type = py_type. clone ( ) ;
7171 let item_obj: PyObject = item. into ( ) ;
7272 py_type. call1 ( ( item_obj, ) ) . map ( |obj| obj. into ( ) )
@@ -266,7 +266,6 @@ fn to_datetime(py: Python, input: &str, custom_format: Option<&str>) -> PyResult
266266 return Err ( PyValueError :: new_err ( "Input string is empty" ) ) ;
267267 }
268268
269- // Attempt parsing using Speedate
270269 // Attempt parsing using Speedate
271270 if let Ok ( parsed_datetime) = SpeeDateTime :: parse_str ( input) {
272271 return Ok ( PyDateTime :: new (
@@ -282,14 +281,6 @@ fn to_datetime(py: Python, input: &str, custom_format: Option<&str>) -> PyResult
282281 ) ?. into ( ) ) ;
283282 }
284283
285- // Try parsing as ISO 8601 datetime with timezone.
286- if let Ok ( datetime) = DateTime :: parse_from_rfc3339 ( input) {
287- let datetime_utc = datetime. with_timezone ( & Utc ) ;
288- return Ok (
289- PyDateTime :: from_timestamp ( py, datetime_utc. timestamp ( ) as f64 , None , ) ?. into ( )
290- ) ;
291- }
292-
293284 // Define custom formats to try, including the optional format.
294285 let mut formats = vec ! [
295286 "%Y-%m-%d" , // ISO 8601 date
0 commit comments