Skip to content

Commit 46f8689

Browse files
committed
Added INTERVAL type support
Signed-off-by: chandr-andr (Kiselev Aleksandr) <chandr@chandr.net>
1 parent 9af7644 commit 46f8689

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/value_converter.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -846,9 +846,9 @@ pub fn py_to_rust(parameter: &pyo3::Bound<'_, PyAny>) -> RustPSQLDriverPyResult<
846846
if let Some(interval) = Interval::from_duration(duration) {
847847
return Ok(PythonDTO::PyInterval(interval));
848848
}
849-
return Err(RustPSQLDriverError::PyToRustValueConversionError(format!(
850-
"Cannot convert timedelta from Python to inner Rust type.",
851-
)));
849+
return Err(RustPSQLDriverError::PyToRustValueConversionError(
850+
"Cannot convert timedelta from Python to inner Rust type.".to_string(),
851+
));
852852
}
853853

854854
if parameter.is_instance_of::<PyList>() | parameter.is_instance_of::<PyTuple>() {
@@ -1459,7 +1459,7 @@ fn postgres_bytes_to_py(
14591459
if let Some(interval) = interval {
14601460
return Ok(InnerInterval(interval).to_object(py));
14611461
}
1462-
return Ok(py.None())
1462+
Ok(py.None())
14631463
}
14641464
// ---------- Array Text Types ----------
14651465
Type::BOOL_ARRAY => Ok(postgres_array_to_py(py, _composite_field_postgres_to_py::<Option<Array<bool>>>(

0 commit comments

Comments
 (0)