From c15ecf238e83d12b4baee56bd702e48205d65614 Mon Sep 17 00:00:00 2001 From: boxdot Date: Mon, 22 Aug 2022 16:45:11 +0200 Subject: [PATCH] Address review comments Signed-off-by: boxdot --- flatdata-rs/lib/src/arrayview.rs | 3 ++- flatdata-rs/lib/src/structs.rs | 3 ++- flatdata-rs/lib/src/vector.rs | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/flatdata-rs/lib/src/arrayview.rs b/flatdata-rs/lib/src/arrayview.rs index 74720460..1ebcf975 100644 --- a/flatdata-rs/lib/src/arrayview.rs +++ b/flatdata-rs/lib/src/arrayview.rs @@ -57,6 +57,7 @@ mod test { }; #[test] + #[allow(clippy::reversed_empty_ranges)] fn range() { let mut vec: Vector = Vector::with_len(3); vec[0].set_first_x(10); @@ -66,7 +67,7 @@ mod test { assert_eq!(vec.len(), 3); assert_eq!(vec[0].x(), 10..20); assert_eq!(vec[1].x(), 20..30); - assert!(vec[2].x().is_empty()); + assert_eq!(vec[2].x(), 30..0); assert_eq!(vec[0..1].len(), 1); assert_eq!(vec[0..1][0].x(), 10..20); diff --git a/flatdata-rs/lib/src/structs.rs b/flatdata-rs/lib/src/structs.rs index c3f0bf95..11c934a2 100644 --- a/flatdata-rs/lib/src/structs.rs +++ b/flatdata-rs/lib/src/structs.rs @@ -143,7 +143,8 @@ mod test { } #[test] + #[allow(clippy::assertions_on_constants)] fn test_range() { - const _: [(); 0 - !{ ::IS_OVERLAPPING_WITH_NEXT } as usize] = []; + assert!(::IS_OVERLAPPING_WITH_NEXT); } } diff --git a/flatdata-rs/lib/src/vector.rs b/flatdata-rs/lib/src/vector.rs index 9cf89aef..3666a4bb 100644 --- a/flatdata-rs/lib/src/vector.rs +++ b/flatdata-rs/lib/src/vector.rs @@ -341,6 +341,7 @@ mod tests { } #[test] + #[allow(clippy::reversed_empty_ranges)] fn test_vector_range() { let mut v: Vector = Vector::with_len(3); v[0].set_first_x(10); @@ -349,7 +350,7 @@ mod tests { assert_eq!(v[0].x(), 10..20); assert_eq!(v[1].x(), 20..30); - assert!(v[2].x().is_empty()); + assert_eq!(v[2].x(), 30..0); } #[test]