Skip to content

Commit 628a77f

Browse files
committed
clippy
1 parent 1914ec2 commit 628a77f

1 file changed

Lines changed: 7 additions & 8 deletions

File tree

src/decode.rs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,7 @@ pub fn deserialize(py: Python, ptr: *mut pyo3::ffi::PyObject) -> PyResult<PyObje
5151
.map_err(|e| JSONDecodeError::py_err((e.to_string(), "", 0)))?;
5252
Ok(unsafe { PyObject::from_owned_ptr(py, py_ptr) })
5353
}
54-
Err(e) => {
55-
return Err(JSONDecodeError::py_err((e.to_string(), "", 0)));
56-
}
54+
Err(e) => Err(JSONDecodeError::py_err((e.to_string(), "", 0))),
5755
}
5856
}
5957

@@ -92,15 +90,16 @@ impl<'de, 'a> Visitor<'de> for JsonValue {
9290
where
9391
E: de::Error,
9492
{
95-
match value {
96-
true => unsafe {
93+
if value {
94+
unsafe {
9795
pyo3::ffi::Py_INCREF(typeref::TRUE);
9896
Ok(typeref::TRUE)
99-
},
100-
false => unsafe {
97+
}
98+
} else {
99+
unsafe {
101100
pyo3::ffi::Py_INCREF(typeref::FALSE);
102101
Ok(typeref::FALSE)
103-
},
102+
}
104103
}
105104
}
106105

0 commit comments

Comments
 (0)