diff --git a/src/r3_core/src/bind/sorter.rs b/src/r3_core/src/bind/sorter.rs index 88eb07cab1..3535d4b008 100644 --- a/src/r3_core/src/bind/sorter.rs +++ b/src/r3_core/src/bind/sorter.rs @@ -587,7 +587,6 @@ trait TopologicalSortOutputSink { /// ¹ Kahn, Arthur B. (1962), "Topological sorting of large networks", /// *Communications of the ACM*, **5** (11): 558–562, doi:10.1145/368996.369025 const fn topological_sort< - 'a, Graph, VertexRef, VertexRefLessThan, @@ -595,7 +594,7 @@ const fn topological_sort< VertexInfoMap, OutputSink, >( - graph: &'a Graph, + graph: &Graph, vertex_ord_lt: &mut VertexRefLessThan, out_vertices: &mut OutputSink, temp_ready_vertex_queue: &mut ReadyVertexQueue, diff --git a/src/r3_port_riscv_test_driver/build.rs b/src/r3_port_riscv_test_driver/build.rs index 007d584547..92c1f954a3 100644 --- a/src/r3_port_riscv_test_driver/build.rs +++ b/src/r3_port_riscv_test_driver/build.rs @@ -26,14 +26,13 @@ fn main() { generated_code, r#" instantiate_test!({{ - path: crate::driver_kernel_tests::{0}, + path: crate::driver_kernel_tests::{name}, }},); "#, - name, ) .unwrap(); } else if !selected_test.is_empty() { - panic!("unknown test type: {:?}", selected_test); + panic!("unknown test type: {selected_test:?}"); } let out_generated_code_path = Path::new(&out_dir).join("gen.rs"); diff --git a/src/r3_port_std/src/threading_unix.rs b/src/r3_port_std/src/threading_unix.rs index 7699898539..3137ae9c98 100644 --- a/src/r3_port_std/src/threading_unix.rs +++ b/src/r3_port_std/src/threading_unix.rs @@ -216,8 +216,8 @@ fn park_inner(data: &ThreadData) { // Interrupted while waiting. Try again. continue; } - Ok(i) => panic!("unexpected return value: {}", i), - Err(e) => panic!("failed to evict park token: {}", e), + Ok(i) => panic!("unexpected return value: {i}"), + Err(e) => panic!("failed to evict park token: {e}"), } break; diff --git a/src/r3_port_std/src/ums/tests.rs b/src/r3_port_std/src/ums/tests.rs index 343bddbfdb..3aeabdea84 100644 --- a/src/r3_port_std/src/ums/tests.rs +++ b/src/r3_port_std/src/ums/tests.rs @@ -105,9 +105,7 @@ fn preempt() { .zip(new_counters.iter()) .enumerate() .all(|(i, (old, new))| (thread_i == i) == (old != new)), - "old_counters = {:?}, new_counters = {:?}", - old_counters, - new_counters, + "old_counters = {old_counters:?}, new_counters = {new_counters:?}", ); }; @@ -226,8 +224,7 @@ fn yield_ring(count: usize) { assert!( new_counters.iter().all(|&c| c != 0), - "new_counters = {:?}", - new_counters, + "new_counters = {new_counters:?}", ); st.done.store(true, Ordering::Relaxed); diff --git a/src/r3_support_rza1/src/gpio.rs b/src/r3_support_rza1/src/gpio.rs index 734f9b64f4..804e35fa3c 100644 --- a/src/r3_support_rza1/src/gpio.rs +++ b/src/r3_support_rza1/src/gpio.rs @@ -40,8 +40,8 @@ unsafe fn clear_bit16(reg: *mut u16, bit: u8) { #[inline] fn panic_if_pin_is_invalid((n, m): Pin) { - assert!(n >= 1 && n < 12, "1 <= {} < 12", n); - assert!(m < 16, "0 <= {} < 16", m); + assert!((1..12).contains(&n), "1 <= {n} < 12"); + assert!(m < 16, "0 <= {m} < 16"); } impl GpioExt for rza1::gpio::RegisterBlock { diff --git a/src/r3_test_runner/src/targets/jlink.rs b/src/r3_test_runner/src/targets/jlink.rs index a2374adc0a..6f5a0b1194 100644 --- a/src/r3_test_runner/src/targets/jlink.rs +++ b/src/r3_test_runner/src/targets/jlink.rs @@ -117,7 +117,7 @@ impl DebugProbe for Fe310JLinkDebugProbe { for (path, (_, offset)) in section_files.iter().zip(regions.iter()) { writeln!(cmd, "loadbin \"{}\" 0x{:08x}", path.display(), offset).unwrap(); } - writeln!(cmd, "setpc 0x{:x}", entry).unwrap(); + writeln!(cmd, "setpc 0x{entry:x}").unwrap(); writeln!(cmd, "g").unwrap(); writeln!(cmd, "q").unwrap(); diff --git a/src/r3_test_suite/build.rs b/src/r3_test_suite/build.rs index a8cf46412f..b58c2cb3b9 100644 --- a/src/r3_test_suite/build.rs +++ b/src/r3_test_suite/build.rs @@ -43,9 +43,8 @@ fn main() { kernel_benchmark_list.push(TestMeta("kernel_benchmarks", name)); } else { panic!( - "Unrecognized test type: `{}` + "Unrecognized test type: `{selected_test}` Test names should start with a prefix like `kernel_tests::`.", - selected_test ); } } @@ -84,9 +83,8 @@ fn main() { fn expect_valid_test_name(name: &str) { if name.contains(|c: char| !c.is_alphanumeric() && c != '_') || name.is_empty() { panic!( - "Invalid test name: `{}` + "Invalid test name: `{name}` Test names should match /[a-zA-Z0-9_]+/", - name ) } } diff --git a/src/r3_test_suite/src/utils.rs b/src/r3_test_suite/src/utils.rs index 3cdd1f8545..d7147dcea0 100644 --- a/src/r3_test_suite/src/utils.rs +++ b/src/r3_test_suite/src/utils.rs @@ -37,7 +37,7 @@ impl SeqTracker { // Note: Some targets don't support CAS atomics let got = self.counter.load(Ordering::Relaxed); log::debug!("{} (expected: {}) → {}", got, old, new); - assert_eq!(got, old, "expected {}, got {}", old, got); + assert_eq!(got, old, "expected {old}, got {got}"); self.counter.store(new, Ordering::Relaxed); } } diff --git a/src/r3_test_suite/src/utils/conditional.rs b/src/r3_test_suite/src/utils/conditional.rs index 888cd4539f..d341c695fd 100644 --- a/src/r3_test_suite/src/utils/conditional.rs +++ b/src/r3_test_suite/src/utils/conditional.rs @@ -86,9 +86,7 @@ pub trait KernelTimeExt: traits::KernelBase { log::trace!("time = {:?}ms (expected = {:?}ms)", t, range); assert!( range.contains(&t), - "time = {:?}ms (expected = {:?}ms)", - t, - range + "time = {t:?}ms (expected = {range:?}ms)" ); }