Skip to content

Commit f9413a7

Browse files
committed
clippy
1 parent a0430c5 commit f9413a7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

crates/processing_pyo3/src/color.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,8 @@ impl PyColor {
388388
fn __getitem__(&self, idx: isize) -> PyResult<f32> {
389389
let c = components(&self.0);
390390
let idx = if idx < 0 { 4 + idx } else { idx };
391-
if idx < 0 || idx >= 4 {
391+
392+
if !(0..4).contains(&idx) {
392393
return Err(PyTypeError::new_err("index out of range"));
393394
}
394395
Ok(c[idx as usize])
@@ -429,7 +430,7 @@ pub(crate) fn extract_color(args: &Bound<'_, PyTuple>) -> PyResult<Color> {
429430

430431
fn parse_hex(s: &str) -> PyResult<Color> {
431432
Srgba::hex(s)
432-
.map(|srgba| Color::Srgba(srgba))
433+
.map(Color::Srgba)
433434
.map_err(|e| PyTypeError::new_err(format!("invalid hex color: {e}")))
434435
}
435436

0 commit comments

Comments
 (0)