Repository: theseus-os/Theseus (language: rust)

Issue:
Add a clippy Make target
The logic from the clippy workflow should be moved into a `clippy` target in the Makefile. The workflow should then invoke the target.

This would allow for easier local testing.


Discussion / hints:
Agreed. I can just finish off the remaining clippy tasks and then we can ditch the whole `lints.txt` file (cc #526) which would make the clippy invocation even simpler
clippy currently gives a gigantic list of warnings. I'm thinking of fixing those warnings. Are they applicable in this project, or is it non-applicable due to the nature of the project?

Fix patch:
diff --git a/.github/workflows/check-clippy.yaml b/.github/workflows/check-clippy.yaml
index b4a8820d57..02ad677a51 100644
--- a/.github/workflows/check-clippy.yaml
+++ b/.github/workflows/check-clippy.yaml
@@ -17,6 +17,4 @@ jobs:
           GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
         working-directory: .
         run: |
-          printf "cargo clippy -q -Z build-std=core,alloc -Z build-std-features=compiler-builtins-mem --target cfg/x86_64-unknown-theseus.json --workspace --features theseus_features/everything --features nano_core/bios -- -A clippy::all " > cmd.txt;
-          grep -v "#" lints.txt | sed 's/^/-D clippy::/g' | tr -d '\r' | tr '\n' ' ' >> cmd.txt
-          bash cmd.txt;
+          make clippy
diff --git a/Makefile b/Makefile
index a3e03abb5e..654784ef94 100644
--- a/Makefile
+++ b/Makefile
@@ -21,6 +21,9 @@ merge_sections ?= yes
 bootloader ?= grub
 boot_spec ?= bios
 
+## Set up configuration based on the chosen bootloader specification (boot_spec).
+export override FEATURES+=--features nano_core/$(boot_spec)
+
 ifeq ($(boot_spec), bios)
 	ISO_EXTENSION := iso
 else ifeq ($(boot_spec), uefi)
@@ -139,7 +142,7 @@ APP_CRATE_NAMES += $(EXTRA_APP_CRATE_NAMES)
 		libtheseus \
 		simd_personality_sse build_sse simd_personality_avx build_avx \
 		gdb \
-		doc docs view-doc view-docs book view-book
+		clippy doc docs view-doc view-docs book view-book
 
 
 ### If we compile for SIMD targets newer than SSE (e.g., AVX or newer),
@@ -289,7 +292,6 @@ endif
 
 
 ## This target invokes the actual Rust build process via `cargo`.
-cargo : export override FEATURES+=--features nano_core/$(boot_spec)
 cargo:
 	@mkdir -p $(BUILD_DIR)
 	@mkdir -p $(NANO_CORE_BUILD_DIR)
@@ -562,12 +564,24 @@ preserve_old_modules:
 	cargo clean
 
 
-
-
 ###################################################################################################
-############################ Targets for building documentation ###################################
+########################### Targets for clippy and documentation ##################################
 ###################################################################################################
 
+## Runs clippy on a full build of Theseus, with all crates included.
+## Note that this does not cover all combinations of features or cfg values.
+##
+## We allow building with THESEUS_CONFIG options, but not with any other RUSTFLAGS,
+## because the default RUSTFLAGS used to build Theseus aren't compatible with clippy.
+clippy : export override FEATURES += --features theseus_features/everything
+clippy : export override RUSTFLAGS = $(patsubst %,--cfg %, $(THESEUS_CONFIG))
+clippy:
+	RUST_TARGET_PATH='$(CFG_DIR)' RUSTFLAGS='$(RUSTFLAGS)' \
+		cargo clippy \
+		$(BUILD_STD_CARGOFLAGS) $(FEATURES) \
+		--target $(TARGET)
+
+
 ## The output directory for source-level documentation.
 RUSTDOC_OUT      := $(BUILD_DIR)/doc
 RUSTDOC_OUT_FILE := $(RUSTDOC_OUT)/___Theseus_Crates___/index.html
diff --git a/applications/channel_eval/src/lib.rs b/applications/channel_eval/src/lib.rs
index 931fdbb032..82fceccecd 100644
--- a/applications/channel_eval/src/lib.rs
+++ b/applications/channel_eval/src/lib.rs
@@ -72,7 +72,7 @@ fn test_multiple(iterations: usize) -> Result<(), &'static str> {
     let t1 = spawn::new_task_builder(|_: ()| -> Result<(), &'static str> {
         info!("test_multiple(): Entered sender task!");
         for i in 0..iterations {
-            sender.send(format!("Message {:03}", i))?;
+            sender.send(format!("Message {i:03}"))?;
             info!("test_multiple(): Sender sent message {:03}", i);
         }
         Ok(())
diff --git a/applications/deps/src/lib.rs b/applications/deps/src/lib.rs
index 944472f4cd..662d3601bb 100644
--- a/applications/deps/src/lib.rs
+++ b/applications/deps/src/lib.rs
@@ -154,14 +154,14 @@ fn section_containing_address(addr: &str) -> Result<(), String> {
     
     let virt_addr = VirtualAddress::new(
         usize::from_str_radix(addr, 16)
-            .map_err(|_| format!("Error: address {:?} is not a valid hexademical usize value", addr))?
-    ).ok_or_else(|| format!("Error: address {:?} is not a valid VirtualAddress", addr))?;
+            .map_err(|_| format!("Error: address {addr:?} is not a valid hexademical usize value"))?
+    ).ok_or_else(|| format!("Error: address {addr:?} is not a valid VirtualAddress"))?;
 
     if let Some((sec, offset)) = get_my_current_namespace().get_section_containing_address(virt_addr, false) {
         println!("Found {:>#018X} in {} + {:#X}, typ: {:?}", virt_addr, sec.name, offset, sec.typ);
         Ok(())
     } else {
-        Err(format!("Couldn't find section containing address {:>#018X}", virt_addr))
+        Err(format!("Couldn't find section containing address {virt_addr:>#018X}"))
     }
 }
 
@@ -392,7 +392,7 @@ fn find_crate(crate_name: &str) -> Result<(StrRef, StrongCrateRef), String> {
     let namespace = get_my_current_namespace();
     let mut matching_crates = CrateNamespace::get_crates_starting_with(&namespace, crate_name);
     match matching_crates.len() {
-        0 => Err(format!("couldn't find crate matching {:?}", crate_name)),
+        0 => Err(format!("couldn't find crate matching {crate_name:?}")),
         1 => {
             let mc = matching_crates.swap_remove(0);
             Ok((mc.0, mc.1)) 
@@ -424,13 +424,13 @@ fn find_section(section_name: &str) -> Result<StrongSectionRef, String> {
 
     // If it wasn't a global section in the symbol map, then we need to find its containing crate
     // and search that crate's symbols manually.
-    let containing_crate_ref = get_containing_crate_name(section_name).get(0)
-        .and_then(|cname| CrateNamespace::get_crate_starting_with(&namespace, &format!("{}-", cname)))
+    let containing_crate_ref = get_containing_crate_name(section_name).first()
+        .and_then(|cname| CrateNamespace::get_crate_starting_with(&namespace, &format!("{cname}-")))
         .or_else(|| get_containing_crate_name(section_name).get(1)
-            .and_then(|cname| CrateNamespace::get_crate_starting_with(&namespace, &format!("{}-", cname)))
+            .and_then(|cname| CrateNamespace::get_crate_starting_with(&namespace, &format!("{cname}-")))
         )
         .map(|(_cname, crate_ref, _ns)| crate_ref)
-        .ok_or_else(|| format!("Couldn't find section {} in symbol map, and couldn't get its containing crate", section_name))?;
+        .ok_or_else(|| format!("Couldn't find section {section_name} in symbol map, and couldn't get its containing crate"))?;
 
     let mut matching_sections: Vec<StrongSectionRef> = containing_crate_ref.lock_as_ref().sections.values()
         .filter_map(|sec| {
diff --git a/applications/hull/src/job.rs b/applications/hull/src/job.rs
index d1a3df3517..18b00a8a2b 100644
--- a/applications/hull/src/job.rs
+++ b/applications/hull/src/job.rs
@@ -46,29 +46,24 @@ impl Job {
 
     pub(crate) fn update(&mut self) -> Option<isize> {
         for mut part in self.parts.iter_mut() {
-            if part.state == State::Running {
-                match part.task.runstate() {
-                    RunState::Exited => {
-                        let exit_value = match part.task.join().unwrap() {
-                            ExitValue::Completed(status) => {
-                                match status.downcast_ref::<isize>() {
-                                    Some(num) => *num,
-                                    // FIXME: Document/decide on a number for when app doesn't
-                                    // return isize.
-                                    None => 210,
-                                }
-                            }
-                            ExitValue::Killed(reason) => match reason {
-                                // FIXME: Document/decide on a number. This is used by bash.
-                                KillReason::Requested => 130,
-                                KillReason::Panic(_) => 1,
-                                KillReason::Exception(num) => num.into(),
-                            },
-                        };
-                        part.state = State::Complete(exit_value);
+            if part.state == State::Running && part.task.runstate() == RunState::Exited {
+                let exit_value = match part.task.join().unwrap() {
+                    ExitValue::Completed(status) => {
+                        match status.downcast_ref::<isize>() {
+                            Some(num) => *num,
+                            // FIXME: Document/decide on a number for when app doesn't
+                            // return isize.
+                            None => 210,
+                        }
                     }
-                    _ => {}
-                }
+                    ExitValue::Killed(reason) => match reason {
+                        // FIXME: Document/decide on a number. This is used by bash.
+                        KillReason::Requested => 130,
+                        KillReason::Panic(_) => 1,
+                        KillReason::Exception(num) => num.into(),
+                    },
+                };
+                part.state = State::Complete(exit_value);
             }
         }
         self.exit_value()
diff --git a/applications/hull/src/lib.rs b/applications/hull/src/lib.rs
index 8f717c2678..3508e9b1f7 100644
--- a/applications/hull/src/lib.rs
+++ b/applications/hull/src/lib.rs
@@ -202,7 +202,7 @@ impl Shell {
             .map(|t| t.get_namespace().dir().clone())
             .expect("couldn't get namespace dir");
 
-        let crate_name = format!("{}-", cmd);
+        let crate_name = format!("{cmd}-");
         let mut matching_files = namespace_dir
             .get_files_starting_with(&crate_name)
             .into_iter();
diff --git a/applications/loadc/src/lib.rs b/applications/loadc/src/lib.rs
index 4f58ecf86e..de4086496a 100644
--- a/applications/loadc/src/lib.rs
+++ b/applications/loadc/src/lib.rs
@@ -74,7 +74,7 @@ fn rmain(matches: Matches) -> Result<c_int, String> {
     let path = matches.free.get(0).ok_or_else(|| "Missing path to ELF executable".to_string())?;
     let path = Path::new(path.clone());
     let file_ref = path.get_file(&curr_wd)
-        .ok_or_else(|| format!("Failed to access file at {:?}", path))?;
+        .ok_or_else(|| format!("Failed to access file at {path:?}"))?;
     let file = file_ref.lock();
 
     // Parse the file as an ELF executable
@@ -232,9 +232,9 @@ fn parse_and_load_elf_executable(
     // Allocate enough virtually-contiguous space for all the segments together.
     let total_size_in_bytes = end_vaddr - start_vaddr;
     let mut all_pages = memory::allocate_pages_by_bytes_at(
-        VirtualAddress::new(start_vaddr).ok_or_else(|| format!("Segment had invalid virtual address {:#X}", start_vaddr))?,
+        VirtualAddress::new(start_vaddr).ok_or_else(|| format!("Segment had invalid virtual address {start_vaddr:#X}"))?,
         total_size_in_bytes
-    ).map_err(|_| format!("Failed to allocate {} bytes at {}", total_size_in_bytes, start_vaddr))?;
+    ).map_err(|_| format!("Failed to allocate {total_size_in_bytes} bytes at {start_vaddr}"))?;
     let vaddr_adjustment = Offset::new(all_pages.start_address().value(), start_vaddr); 
 
     // Iterate through each segment again and map them into pages we just allocated above,
@@ -270,7 +270,7 @@ fn parse_and_load_elf_executable(
         // debug!("Splitting {:?} after end page {:?}", all_pages, end_page);
 
         let (this_ap, remaining_pages) = all_pages.split(end_page + 1).map_err(|_ap|
-            format!("Failed to split allocated pages {:?} at page {:#X}", _ap, start_vaddr)
+            format!("Failed to split allocated pages {_ap:?} at page {start_vaddr:#X}")
         )?;
         all_pages = remaining_pages;
         // debug!("Successfully split pages into {:?} and {:?}", this_ap, all_pages);
@@ -285,7 +285,7 @@ fn parse_and_load_elf_executable(
 
         // Copy data from this section into the correct offset into our newly-mapped pages
         let offset_into_mp = mp.offset_of_address(start_vaddr).ok_or_else(|| 
-            format!("BUG: destination address {:#X} wasn't within segment's {:?}", start_vaddr, mp)
+            format!("BUG: destination address {start_vaddr:#X} wasn't within segment's {mp:?}")
         )?;
         match prog_hdr.get_data(&elf_file).map_err(String::from)? {
             SegmentData::Undefined(segment_data) => {
@@ -326,7 +326,7 @@ fn parse_and_load_elf_executable(
 
     let entry_point = elf_file.header.pt2.entry_point() as usize;
     let mut entry_point_vaddr = VirtualAddress::new(entry_point)
-        .ok_or_else(|| format!("ELF entry point was invalid virtual address: {:#X}", entry_point))?;
+        .ok_or_else(|| format!("ELF entry point was invalid virtual address: {entry_point:#X}"))?;
     Offset::adjust_assign(&mut entry_point_vaddr, vaddr_adjustment);
     debug!("ELF had entry point {:#X}, adjusted to {:#X}", entry_point, entry_point_vaddr);
 
@@ -374,7 +374,7 @@ fn overwrite_relocations(
         let rela_array = match sec.get_data(elf_file) {
             Ok(Rela64(rela_arr)) => rela_arr,
             _ => {
-                let err = format!("Found Rela section that wasn't able to be parsed as Rela64: {:?}", sec);
+                let err = format!("Found Rela section that wasn't able to be parsed as Rela64: {sec:?}");
                 error!("{}", err);
                 return Err(err);
             } 
diff --git a/applications/ls/src/lib.rs b/applications/ls/src/lib.rs
index 735f1fa890..ed8fbdd51f 100644
--- a/applications/ls/src/lib.rs
+++ b/applications/ls/src/lib.rs
@@ -69,7 +69,7 @@ fn print_children(dir: &DirRef) {
     let mut child_list = dir.lock().list(); 
     child_list.reverse();
     for child in child_list.iter() {
-        writeln!(child_string, "{}", child).expect("Failed to write child_string");
+        writeln!(child_string, "{child}").expect("Failed to write child_string");
     }
     println!("{}", child_string);
 }
diff --git a/applications/ns/src/lib.rs b/applications/ns/src/lib.rs
index d0b1e973aa..01bf905915 100644
--- a/applications/ns/src/lib.rs
+++ b/applications/ns/src/lib.rs
@@ -70,7 +70,7 @@ fn rmain(matches: Matches) -> Result<(), String> {
     if let Some(crate_obj_file_path) = matches.opt_str("load") {
         let path = Path::new(crate_obj_file_path);
         let file = path.get_file(&curr_wd).ok_or_else(||
-            format!("Couldn't resolve path to crate object file at {:?}", path)
+            format!("Couldn't resolve path to crate object file at {path:?}")
         )?;
         load_crate(&mut output, file, &namespace)?;
     } else if matches.opt_present("f") {
@@ -127,7 +127,7 @@ fn print_crates(output: &mut String, indent: usize, namespace: &CrateNamespace,
     });
     crates.sort();
     for c in crates {
-        writeln!(output, "{}", c)?;
+        writeln!(output, "{c}")?;
     }
 
     if recursive {
diff --git a/applications/ping/src/lib.rs b/applications/ping/src/lib.rs
index 6749ac4938..14805d4986 100644
--- a/applications/ping/src/lib.rs
+++ b/applications/ping/src/lib.rs
@@ -334,8 +334,8 @@ fn ping(address: IpAddress, count: usize, interval: u64, timeout: u64, verbose:
         0 as f64
     };
      
-    let min_ping = times.iter().min().unwrap_or_else(|| &0);
-    let max_ping = times.iter().max().unwrap_or_else(|| &0);
+    let min_ping = times.iter().min().unwrap_or(&0);
+    let max_ping = times.iter().max().unwrap_or(&0);
     
     println!("\n--- {} ping statistics ---", remote_addr);
     println!("{} packets transmitted, {} received, {:.0}% packet loss \nrtt min/avg/max = {}/{}/{}",
diff --git a/applications/ps/src/lib.rs b/applications/ps/src/lib.rs
index 1293307585..78dab58563 100644
--- a/applications/ps/src/lib.rs
+++ b/applications/ps/src/lib.rs
@@ -53,8 +53,8 @@ pub fn main(args: Vec<String>) -> isize {
         else {
             // All printed fields below must be strings to ensure the width formatting specifier below works properly.
             let runstate = format!("{:?}", task.runstate());
-            let cpu = task.running_on_cpu().map(|cpu| format!("{}", cpu)).unwrap_or_else(|| String::from("-"));
-            let pinned = task.pinned_core().map(|pin| format!("{}", pin)).unwrap_or_else(|| String::from("-"));
+            let cpu = task.running_on_cpu().map(|cpu| format!("{cpu}")).unwrap_or_else(|| String::from("-"));
+            let pinned = task.pinned_core().map(|pin| format!("{pin}")).unwrap_or_else(|| String::from("-"));
             let task_type = if task.is_an_idle_task {"I"}
                 else if task.is_application() {"A"}
                 else {" "} ;
diff --git a/applications/rm/src/lib.rs b/applications/rm/src/lib.rs
index 431e262c8b..70f0df7be0 100644
--- a/applications/rm/src/lib.rs
+++ b/applications/rm/src/lib.rs
@@ -59,7 +59,7 @@ pub fn remove_node(args: Vec<String>) -> Result<(), String> {
         let path = Path::new(path_string.clone());
         let node_to_delete = match path.get(&working_dir) {
             Some(node) => node,
-            _ => return Err(format!("Couldn't find path {}", path)),
+            _ => return Err(format!("Couldn't find path {path}")),
         };
 
         // Only remove directories if the user specified "-r". 
diff --git a/applications/shell/src/lib.rs b/applications/shell/src/lib.rs
index efb5308cce..bbe489e012 100644
--- a/applications/shell/src/lib.rs
+++ b/applications/shell/src/lib.rs
@@ -513,16 +513,13 @@ impl Shell {
                 self.redisplay_prompt();
                 return Ok(());
             } else if let Some(ref fg_job_num) = self.fg_job_num { // send buffered characters to the running application
-                match self.jobs.get(fg_job_num) {
-                    Some(job) => {
-                        self.terminal.lock().print_to_terminal("\n".to_string());
-                        let mut buffered_string = String::new();
-                        mem::swap(&mut buffered_string, &mut self.input_buffer);
-                        buffered_string.push('\n');
-                        job.stdin_writer.lock().write_all(buffered_string.as_bytes())
-                            .or(Err("shell failed to write to stdin"))?;
-                    },
-                    _ => {}
+                if let Some(job) = self.jobs.get(fg_job_num) {
+                    self.terminal.lock().print_to_terminal("\n".to_string());
+                    let mut buffered_string = String::new();
+                    mem::swap(&mut buffered_string, &mut self.input_buffer);
+                    buffered_string.push('\n');
+                    job.stdin_writer.lock().write_all(buffered_string.as_bytes())
+                        .or(Err("shell failed to write to stdin"))?;
                 }
                 return Ok(());
             } else { // start a new job
@@ -639,7 +636,7 @@ impl Shell {
         let namespace_dir = task::with_current_task(|t|
             t.get_namespace().dir().clone()
         ).map_err(|_| AppErr::NamespaceErr)?;
-        let cmd_crate_name = format!("{}-", cmd);
+        let cmd_crate_name = format!("{cmd}-");
         let mut matching_apps = namespace_dir.get_files_starting_with(&cmd_crate_name).into_iter();
         let app_file = matching_apps.next();
         let second_match = matching_apps.next(); // return an error if there are multiple matching apps 
@@ -779,15 +776,15 @@ impl Shell {
                             String::new()
                         }
                         else {
-                            format!("{:?} command not found.\n", command)
+                            format!("{command:?} command not found.\n")
                         }
                     },
                     AppErr::NamespaceErr      => "Failed to find directory of application executables.\n".to_string(),
-                    AppErr::SpawnErr(e)       => format!("Failed to spawn new task to run command. Error: {}.\n", e),
+                    AppErr::SpawnErr(e)       => format!("Failed to spawn new task to run command. Error: {e}.\n"),
                 };
                 self.terminal.lock().print_to_terminal(err_msg);
                 if let Err(msg) = self.clear_cmdline(false) {
-                    self.terminal.lock().print_to_terminal(format!("{}\n", msg));
+                    self.terminal.lock().print_to_terminal(format!("{msg}\n"));
                 }
                 self.redisplay_prompt();
                 Err("Failed to evaluate command line.")
@@ -1036,7 +1033,7 @@ impl Shell {
                             info!("terminal: task [{}] returned exit value: {:?}", exited_task_id, val);
                             if let Some(val) = val {
                                 self.terminal.lock().print_to_terminal(
-                                    format!("task [{}] exited with code {} ({:#X})\n", exited_task_id, val, val)
+                                    format!("task [{exited_task_id}] exited with code {val} ({val:#X})\n")
                                 );
                             }
                         },
@@ -1049,12 +1046,11 @@ impl Shell {
                         Ok(ExitValue::Killed(kill_reason)) => {
                             warn!("task [{}] was killed because {:?}", exited_task_id, kill_reason);
                             self.terminal.lock().print_to_terminal(
-                                format!("task [{}] was killed because {:?}\n", exited_task_id, kill_reason)
+                                format!("task [{exited_task_id}] was killed because {kill_reason:?}\n")
                             );
                         }
                         Err(_e) => {
-                            let err_msg = format!("Failed to `join` task [{}] {:?}, error: {:?}",
-                                exited_task_id, task_ref, _e,
+                            let err_msg = format!("Failed to `join` task [{exited_task_id}] {task_ref:?}, error: {_e:?}",
                             );
                             error!("{}", err_msg);
                             self.terminal.lock().print_to_terminal(err_msg);
@@ -1170,7 +1166,7 @@ impl Shell {
     fn redisplay_prompt(&mut self) {
         let curr_env = self.env.lock();
         let mut prompt = curr_env.working_dir.lock().get_absolute_path();
-        prompt = format!("{}: ",prompt);
+        prompt = format!("{prompt}: ");
         self.terminal.lock().print_to_terminal(prompt);
         self.terminal.lock().print_to_terminal(self.cmdline.clone());
     }
@@ -1181,11 +1177,8 @@ impl Shell {
 
         // Support for legacy output by `terminal_print`.
         if let Some(print_event) = self.print_consumer.peek() {
-            match print_event.deref() {
-                Event::OutputEvent(ref s) => {
-                    self.terminal.lock().print_to_terminal(s.clone());
-                },
-                _ => { },
+            if let Event::OutputEvent(ref s) = print_event.deref() {
+                self.terminal.lock().print_to_terminal(s.clone());
             }
             print_event.mark_completed();
             // Goes to the next iteration of the loop after processing print event to ensure that printing is handled before keypresses
@@ -1410,7 +1403,7 @@ impl Shell {
                     self.redisplay_prompt();
                     return Ok(());
                 }
-                self.terminal.lock().print_to_terminal(format!("No job number {} found!\n", job_num));
+                self.terminal.lock().print_to_terminal(format!("No job number {job_num} found!\n"));
                 return Ok(());
             }
         }
@@ -1442,7 +1435,7 @@ impl Shell {
                     }
                     return Ok(());
                 }
-                self.terminal.lock().print_to_terminal(format!("No job number {} found!\n", job_num));
+                self.terminal.lock().print_to_terminal(format!("No job number {job_num} found!\n"));
                 return Ok(());
             }
         }
diff --git a/applications/swap/src/lib.rs b/applications/swap/src/lib.rs
index c42fa66ce1..01cf808b4f 100644
--- a/applications/swap/src/lib.rs
+++ b/applications/swap/src/lib.rs
@@ -75,7 +75,7 @@ fn rmain(matches: Matches) -> Result<(), String> {
         let path = Path::new(path);
         let dir = match path.get(&curr_dir) {
             Some(FileOrDir::Dir(dir)) => dir,
-            _ => return Err(format!("Error: could not find specified namespace crate directory: {}.", path)),
+            _ => return Err(format!("Error: could not find specified namespace crate directory: {path}.")),
         };
         Some(NamespaceDir::new(dir))
     } else {
@@ -179,7 +179,7 @@ fn do_swap(
                 into_new_crate_file,
                 new_namespace,
                 reexport
-            ).map_err(|invalid_req| format!("{:#?}", invalid_req))?;
+            ).map_err(|invalid_req| format!("{invalid_req:#?}"))?;
             requests.push(swap_req);
         }
         requests
diff --git a/applications/upd/src/lib.rs b/applications/upd/src/lib.rs
index 6ce320b71d..f82fc6c55c 100644
--- a/applications/upd/src/lib.rs
+++ b/applications/upd/src/lib.rs
@@ -127,7 +127,7 @@ fn rmain(matches: Matches) -> Result<(), String> {
             apply(&Path::new(base_dir_path.clone()))
         }
         other => {
-            Err(format!("unrecognized command {:?}", other))
+            Err(format!("unrecognized command {other:?}"))
         }
     }
 }
@@ -178,7 +178,7 @@ fn download(remote_endpoint: IpEndpoint, update_build: &str, crate_list: Option<
         ota_update_client::download_crates(&iface, remote_endpoint, update_build, crate_set).map_err(|e| e.to_string())?
     } else {
         let diff_lines = ota_update_client::download_diff(&iface, remote_endpoint, update_build)
-            .map_err(|e| format!("failed to download diff file for {}, error: {}", update_build, e))?;
+            .map_err(|e| format!("failed to download diff file for {update_build}, error: {e}"))?;
         let diff = ota_update_client::parse_diff_lines(&diff_lines).map_err(|e| e.to_string())?;
 
         // download all of the new crates
@@ -226,11 +226,11 @@ fn apply(base_dir_path: &Path) -> Result<(), String> {
     };
     let new_namespace_dir = match base_dir_path.get(&curr_dir) {
         Some(FileOrDir::Dir(d)) => NamespaceDir::new(d),
-        _ => return Err(format!("cannot find an update base directory at path {}", base_dir_path)),
+        _ => return Err(format!("cannot find an update base directory at path {base_dir_path}")),
     };
     let diff_file = match new_namespace_dir.lock().get(DIFF_FILE_NAME) { 
         Some(FileOrDir::File(f)) => f,
-        _ => return Err(format!("cannot find diff file expected at {}/{}", base_dir_path, DIFF_FILE_NAME)),
+        _ => return Err(format!("cannot find diff file expected at {base_dir_path}/{DIFF_FILE_NAME}")),
     };
     let mut diff_content: Vec<u8> = alloc::vec::from_elem(0, diff_file.lock().len()); 
     let _bytes_read = diff_file.lock().read_at(&mut diff_content, 0)?;
@@ -266,7 +266,7 @@ fn apply(base_dir_path: &Path) -> Result<(), String> {
         };
         
         let new_crate_file = new_namespace_dir.get_crate_object_file(&new_crate_module_file_name).ok_or_else(|| 
-            format!("cannot find new crate file {:?} in new namespace dir {}", new_crate_module_file_name, base_dir_path)
+            format!("cannot find new crate file {new_crate_module_file_name:?} in new namespace dir {base_dir_path}")
         )?;
 
         let swap_req = SwapRequest::new(
@@ -275,7 +275,7 @@ fn apply(base_dir_path: &Path) -> Result<(), String> {
             IntoCrateObjectFile::File(new_crate_file),
             None, // all diff-based swaps occur within the same namespace
             false
-        ).map_err(|invalid_req| format!("{:#?}", invalid_req))?;
+        ).map_err(|invalid_req| format!("{invalid_req:#?}"))?;
         swap_requests.push(swap_req);
     }
 
@@ -288,7 +288,7 @@ fn apply(base_dir_path: &Path) -> Result<(), String> {
         kernel_mmi_ref,
         false, // verbose logging
         false, // enable_crate_cache
-    ).map_err(|e| format!("crate swapping failed, error: {}", e))?;
+    ).map_err(|e| format!("crate swapping failed, error: {e}"))?;
 
     Ok(())
 }
@@ -322,7 +322,7 @@ fn make_unique_directory(base_name: &str, parent_dir: &DirRef) -> Result<DirRef,
         return VFSDirectory::create(base_name.to_string(), parent_dir);
     }
     for i in 1.. {
-        let new_base_name = format!("{}.{}", base_name, i);
+        let new_base_name = format!("{base_name}.{i}");
         if parent_dir.lock().get(&new_base_name).is_none() {
             return VFSDirectory::create(new_base_name, parent_dir);
         }   
diff --git a/kernel/acpi/madt/src/lib.rs b/kernel/acpi/madt/src/lib.rs
index ec1743e7b8..d302b184c8 100644
--- a/kernel/acpi/madt/src/lib.rs
+++ b/kernel/acpi/madt/src/lib.rs
@@ -324,7 +324,7 @@ fn handle_bsp_lapic_entry(madt_iter: MadtIter, page_table: &mut PageTable) -> Re
             ) {
                 // this `lapic_entry` wasn't for the BSP, try the next one.
                 Err(LapicInitError::NotBSP) => continue,
-                Err(other_err) => return Err(Box::leak(format!("{:?}", other_err).into_boxed_str())),
+                Err(other_err) => return Err(Box::leak(format!("{other_err:?}").into_boxed_str())),
                 Ok(()) => { } // fall through
             };
 
@@ -398,15 +398,12 @@ fn handle_ioapic_entries(madt_iter: MadtIter, page_table: &mut PageTable) -> Res
 /// If no entry exists, it returns the default NMI entry value: `(lint = 1, flags = 0)`.
 pub fn find_nmi_entry_for_processor(processor: u8, madt_iter: MadtIter) -> (u8, u16) {
     for madt_entry in madt_iter {
-        match madt_entry {
-            MadtEntry::NonMaskableInterrupt(nmi) => {
-                // NMI entries are based on the "processor" id, not the "apic_id"
-                // Return this Nmi entry if it's for the given lapic, or if it's for all lapics
-                if nmi.processor == processor || nmi.processor == 0xFF  {
-                    return (nmi.lint, nmi.flags);
-                }
+        if let MadtEntry::NonMaskableInterrupt(nmi) = madt_entry {
+            // NMI entries are based on the "processor" id, not the "apic_id"
+            // Return this Nmi entry if it's for the given lapic, or if it's for all lapics
+            if nmi.processor == processor || nmi.processor == 0xFF  {
+                return (nmi.lint, nmi.flags);
             }
-            _ => {  }
         }
     }
 
diff --git a/kernel/acpi/src/lib.rs b/kernel/acpi/src/lib.rs
index 81a5b16e15..05631126cd 100644
--- a/kernel/acpi/src/lib.rs
+++ b/kernel/acpi/src/lib.rs
@@ -106,32 +106,29 @@ pub fn init(rsdp_address: Option<PhysicalAddress>, page_table: &mut PageTable) -
             );
 
             for table in dmar_table.iter() {
-                match table {
-                    dmar::DmarEntry::Drhd(drhd) => {
-                        debug!("Found DRHD table: INCLUDE_PCI_ALL: {:?}, segment_number: {:#X}, register_base_address: {:#X}", 
-                            drhd.include_pci_all(), drhd.segment_number(), drhd.register_base_address(),
+                if let dmar::DmarEntry::Drhd(drhd) = table {
+                    debug!("Found DRHD table: INCLUDE_PCI_ALL: {:?}, segment_number: {:#X}, register_base_address: {:#X}", 
+                        drhd.include_pci_all(), drhd.segment_number(), drhd.register_base_address(),
+                    );
+                    if !drhd.include_pci_all() {
+                        info!("No IOMMU support when INCLUDE_PCI_ALL not set in DRHD");
+                    } else {
+                        let register_base_address = PhysicalAddress::new(drhd.register_base_address() as usize)
+                            .ok_or("IOMMU register_base_address was invalid")?;
+                        iommu::init(
+                            dmar_table.host_address_width(),
+                            drhd.segment_number(), 
+                            register_base_address,
+                            page_table
+                        )?;
+                    }
+                    debug!("DRHD table has Device Scope entries:");
+                    for (_idx, dev_scope) in drhd.iter().enumerate() {
+                        debug!("    Device Scope [{}]: type: {}, enumeration_id: {}, start_bus_number: {}", 
+                            _idx, dev_scope.device_type(), dev_scope.enumeration_id(), dev_scope.start_bus_number(),
                         );
-                        if !drhd.include_pci_all() {
-                            info!("No IOMMU support when INCLUDE_PCI_ALL not set in DRHD");
-                        } else {
-                            let register_base_address = PhysicalAddress::new(drhd.register_base_address() as usize)
-                                .ok_or("IOMMU register_base_address was invalid")?;
-                            iommu::init(
-                                dmar_table.host_address_width(),
-                                drhd.segment_number(), 
-                                register_base_address,
-                                page_table
-                            )?;
-                        }
-                        debug!("DRHD table has Device Scope entries:");
-                        for (_idx, dev_scope) in drhd.iter().enumerate() {
-                            debug!("    Device Scope [{}]: type: {}, enumeration_id: {}, start_bus_number: {}", 
-                                _idx, dev_scope.device_type(), dev_scope.enumeration_id(), dev_scope.start_bus_number(),
-                            );
-                            debug!("                  path: {:?}", dev_scope.path());
-                        }
+                        debug!("                  path: {:?}", dev_scope.path());
                     }
-                    _ => { }
                 }
             }
         }
diff --git a/kernel/app_io/src/lib.rs b/kernel/app_io/src/lib.rs
index 3b898623db..23b0f678d3 100644
--- a/kernel/app_io/src/lib.rs
+++ b/kernel/app_io/src/lib.rs
@@ -212,7 +212,7 @@ pub fn print_to_stdout_args(fmt_args: core::fmt::Arguments) {
         Some(queues) => {
             if queues
                 .stdout
-                .write_all(format!("{}", fmt_args).as_bytes())
+                .write_all(format!("{fmt_args}").as_bytes())
                 .is_err()
             {
                 let _ = logger::write_str("\x1b[31m [E] failed to write to stdout \x1b[0m\n");
diff --git a/kernel/ata/src/lib.rs b/kernel/ata/src/lib.rs
index 61debf4ec5..356f2155b8 100644
--- a/kernel/ata/src/lib.rs
+++ b/kernel/ata/src/lib.rs
@@ -1067,12 +1067,12 @@ impl fmt::Display for AtaSerialNumber {
 	fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
 		core::str::from_utf8(&self.0)
 			.map_err(|_| fmt::Error)
-			.and_then(|s| write!(f, "{}", s))
+			.and_then(|s| write!(f, "{s}"))
 	}
 }
 impl fmt::Debug for AtaSerialNumber {
 	fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
-		write!(f, "\"{}\"", self)
+		write!(f, "\"{self}\"")
 	}
 }
 
@@ -1093,12 +1093,12 @@ impl fmt::Display for AtaModelNumber {
 	fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
 		core::str::from_utf8(&self.0)
 			.map_err(|_| fmt::Error)
-			.and_then(|s| write!(f, "{}", s))
+			.and_then(|s| write!(f, "{s}"))
 	}
 }
 impl fmt::Debug for AtaModelNumber {
 	fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
-		write!(f, "\"{}\"", self)
+		write!(f, "\"{self}\"")
 	}
 }
 
@@ -1114,11 +1114,11 @@ impl fmt::Display for AtaFirmwareVersion {
 	fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
 		core::str::from_utf8(&self.0)
 			.map_err(|_| fmt::Error)
-			.and_then(|s| write!(f, "{}", s))
+			.and_then(|s| write!(f, "{s}"))
 	}
 }
 impl fmt::Debug for AtaFirmwareVersion {
 	fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
-		write!(f, "\"{}\"", self)
+		write!(f, "\"{self}\"")
 	}
 }
diff --git a/kernel/boot_info/src/uefi.rs b/kernel/boot_info/src/uefi.rs
index aa8145bf90..315d8f065c 100644
--- a/kernel/boot_info/src/uefi.rs
+++ b/kernel/boot_info/src/uefi.rs
@@ -86,7 +86,7 @@ impl crate::Module for Module {
                 .iter()
                 .find(|region| region.kind == MODULES_MEMORY_KIND)
                 .expect("no modules region")
-                .start as usize
+                .start
                 + self.inner.offset,
         )
     }
@@ -169,14 +169,14 @@ impl crate::BootInformation for &'static uefi_bootloader_api::BootInformation {
                 .filter(|section| section.size > 0)
                 .map(|section| section.start + section.size)
                 .max()
-                .ok_or("couldn't find kernel end address")? as usize,
+                .ok_or("couldn't find kernel end address")?
         )
         .ok_or("kernel virtual end address was invalid")
     }
 
     fn rsdp(&self) -> Option<PhysicalAddress> {
         self.rsdp_address
-            .map(|address| PhysicalAddress::new_canonical(address))
+            .map(PhysicalAddress::new_canonical)
     }
 
     fn stack_size(&self) -> Result<usize, &'static str> {
diff --git a/kernel/console/src/lib.rs b/kernel/console/src/lib.rs
index af1be2452c..e4320cc041 100644
--- a/kernel/console/src/lib.rs
+++ b/kernel/console/src/lib.rs
@@ -79,7 +79,7 @@ fn console_connection_detector(
         }
 
         if spawn::new_task_builder(shell_loop, (serial_port, serial_port_address, receiver))
-            .name(format!("{:?}_manager", serial_port_address))
+            .name(format!("{serial_port_address:?}_manager"))
             .spawn()
             .is_err()
         {
@@ -103,10 +103,10 @@ fn shell_loop(
     let tty = tty::Tty::new();
 
     let reader_task = spawn::new_task_builder(tty_to_port_loop, (port.clone(), tty.master()))
-        .name(format!("tty_to_{:?}", address))
+        .name(format!("tty_to_{address:?}"))
         .spawn()?;
     let writer_task = spawn::new_task_builder(port_to_tty_loop, (receiver, tty.master()))
-        .name(format!("{:?}_to_tty", address))
+        .name(format!("{address:?}_to_tty"))
         .spawn()?;
 
     let new_app_ns = mod_mgmt::create_application_namespace(None)?;
@@ -117,7 +117,7 @@ fn shell_loop(
 
     let path = path::Path::new(app_file.lock().get_absolute_path());
     let task = spawn::new_application_task_builder(path, Some(new_app_ns))?
-        .name(format!("{:?}_shell", address))
+        .name(format!("{address:?}_shell"))
         .block()
         .spawn()?;
 
diff --git a/kernel/crate_swap/src/lib.rs b/kernel/crate_swap/src/lib.rs
index 0b04c0614f..4dfc4e3bfa 100644
--- a/kernel/crate_swap/src/lib.rs
+++ b/kernel/crate_swap/src/lib.rs
@@ -197,7 +197,7 @@ pub fn swap_crates(
         (
             SwapRequestList::with_capacity(swap_requests.len()),
             CrateNamespace::new(
-                format!("cached_crates--{:?}", swap_requests), 
+                format!("cached_crates--{swap_requests:?}"), 
                 this_namespace.dir().clone(),
                 None
             ),
diff --git a/kernel/debug_info/src/lib.rs b/kernel/debug_info/src/lib.rs
index 257e0d6b73..96e9542207 100644
--- a/kernel/debug_info/src/lib.rs
+++ b/kernel/debug_info/src/lib.rs
@@ -290,12 +290,9 @@ impl DebugSections {
                 let mut evaluation = location.data.evaluation(context.unit.encoding());
                 let eval_result = evaluation.evaluate()?;
                 debug!("{:indent$}Evaluation result {:X?}", "", eval_result, indent = ((depth+3) * 2));
-                match eval_result {
-                    gimli::EvaluationResult::Complete => {
-                        let pieces = evaluation.result();
-                        debug!("{:indent$}Completed evaluation: {:X?}", "", pieces, indent = ((depth+4) * 2));
-                    }
-                    _ => { }
+                if let gimli::EvaluationResult::Complete = eval_result {
+                    let pieces = evaluation.result();
+                    debug!("{:indent$}Completed evaluation: {:X?}", "", pieces, indent = ((depth+4) * 2));
                 }
                 // TODO FIXME: check if one of the variable's location ranges contains the instruction pointer
                 let _type_signature = match entry.attr_value(gimli::DW_AT_type)? {
diff --git a/kernel/fault_crate_swap/src/lib.rs b/kernel/fault_crate_swap/src/lib.rs
index 894384bf9e..e3c2ac5fed 100644
--- a/kernel/fault_crate_swap/src/lib.rs
+++ b/kernel/fault_crate_swap/src/lib.rs
@@ -87,7 +87,7 @@ pub fn do_self_swap(
             into_new_crate_file,
             new_namespace,
             false, //reexport
-        ).map_err(|invalid_req| format!("{:#?}", invalid_req))?;
+        ).map_err(|invalid_req| format!("{invalid_req:#?}"))?;
 
         #[cfg(not(downtime_eval))]
         debug!("swap call {:?}", swap_req);
@@ -352,11 +352,8 @@ pub fn self_swap_handler(crate_name: &str) -> Result<SwapRanges, String> {
         ); 
         // debug!("Bottom and top of stack of task {} are {:X} {:X}", taskref.name, bottom, top);
 
-        match constant_offset_fix(&swap_ranges, bottom, top) {
-            Err (e) => {
-                debug! {"Failed to perform constant offset fix for the stack for task {} due to {}", taskref.name, e.to_string()};
-            },
-            _ => {},
+        if let Err (e) = constant_offset_fix(&swap_ranges, bottom, top) {
+            debug! {"Failed to perform constant offset fix for the stack for task {} due to {}", taskref.name, e.to_string()};
         }
     }
 
diff --git a/kernel/framebuffer_printer/src/lib.rs b/kernel/framebuffer_printer/src/lib.rs
index 03e3609699..a5a932374c 100644
--- a/kernel/framebuffer_printer/src/lib.rs
+++ b/kernel/framebuffer_printer/src/lib.rs
@@ -14,7 +14,7 @@ use framebuffer::{Framebuffer, Pixel};
 use shapes::{Coord, Rectangle};
 
 
-type ASCII = u8;
+type Ascii = u8;
 
 /// Prints a string in a framebuffer.
 /// Returns (column, line, rectangle), i.e. the position of the next symbol and an rectangle which covers the updated area.
@@ -151,7 +151,7 @@ pub fn print_string<P: Pixel>(
 /// * `column`, `line`: the location of the character in the text block as symbols.
 pub fn print_ascii_character<P: Pixel>(
     framebuffer: &mut Framebuffer<P>,
-    character: ASCII,
+    character: Ascii,
     fg_pixel: P,
     bg_pixel: P,
     coordinate: Coord,
diff --git a/kernel/iommu/src/regs.rs b/kernel/iommu/src/regs.rs
index 0d0b638982..8b15b43f88 100644
--- a/kernel/iommu/src/regs.rs
+++ b/kernel/iommu/src/regs.rs
@@ -159,21 +159,21 @@ impl fmt::Debug for ExtendedCapability {
 #[repr(u32)]
 pub enum GlobalCommand {
     /// Compatibility Format Interrupt
-    CFI   = 1 << 23,
+    Cfi   = 1 << 23,
     /// Set Interrupt Remap Table Pointer
-    SIRTP = 1 << 24,
+    Sirtp = 1 << 24,
     /// Interrupt Remapping Enable
-    IRE   = 1 << 25,
+    Ire   = 1 << 25,
     /// Queued Invalidation Enable
-    QIE   = 1 << 26,
+    Qie   = 1 << 26,
     /// Write Buffer Flush
-    WBF   = 1 << 27,
+    Wbf   = 1 << 27,
     /// Enable Advanced Fault Logging
-    EAFL  = 1 << 28,
+    Eafl  = 1 << 28,
     /// Set Fault Log
-    SFL   = 1 << 29,
+    Sfl   = 1 << 29,
     /// Set Root Table Pointer
-    SRTP  = 1 << 30,
+    Srtp  = 1 << 30,
     /// Translation Enable
     TE    = 1 << 31,
 }
diff --git a/kernel/ixgbe/src/lib.rs b/kernel/ixgbe/src/lib.rs
index 8f0318efa0..e73726604e 100644
--- a/kernel/ixgbe/src/lib.rs
+++ b/kernel/ixgbe/src/lib.rs
@@ -328,7 +328,7 @@ impl IxgbeNic {
         Self::clear_stats(&mapped_registers2);
 
         // store the mac address of this device
-        let mac_addr_hardware = Self::read_mac_address_from_nic(&mut mapped_registers_mac);
+        let mac_addr_hardware = Self::read_mac_address_from_nic(&mapped_registers_mac);
 
         // initialize the buffer pool
         init_rx_buf_pool(RX_BUFFER_POOL_SIZE, rx_buffer_size_kbytes as u16 * 1024, &RX_BUFFER_POOL)?;
diff --git a/kernel/mlx_ethernet/src/command_queue.rs b/kernel/mlx_ethernet/src/command_queue.rs
index 720dd838f1..f2f7aa0999 100644
--- a/kernel/mlx_ethernet/src/command_queue.rs
+++ b/kernel/mlx_ethernet/src/command_queue.rs
@@ -1,5 +1,7 @@
- //! Defines the Command Queue that is used to pass commands from the driver to the NIC.
- //! Also defines multiple enums that specify the valid input and output values for different commands.
+//! Defines the Command Queue that is used to pass commands from the driver to the NIC.
+//! Also defines multiple enums that specify the valid input and output values for different commands.
+
+#![allow(clippy::upper_case_acronyms)]
 
 use alloc::{vec::Vec, boxed::Box};
 use memory::{PhysicalAddress, MappedPages, create_contiguous_mapping, BorrowedSliceMappedPages, Mutable};
@@ -1197,7 +1199,7 @@ impl CommandQueue {
 
         let dest_list_mb: usize = libm::ceilf((0x30 + 0x300) as f32 / MAILBOX_DATA_SIZE_IN_BYTES as f32) as usize;
         const DEST_LIST_MB_OFFSET: usize = 304; 
-        let dest_list = DestinationEntry::init(DestinationType::TIR, tirn);
+        let dest_list = DestinationEntry::init(DestinationType::Tir, tirn);
         input_mailbox_buffers[dest_list_mb - 1].write_to_mailbox(dest_list, DEST_LIST_MB_OFFSET)?;
 
         Ok(())
diff --git a/kernel/mlx_ethernet/src/flow_table.rs b/kernel/mlx_ethernet/src/flow_table.rs
index c55986025d..34929a762b 100644
--- a/kernel/mlx_ethernet/src/flow_table.rs
+++ b/kernel/mlx_ethernet/src/flow_table.rs
@@ -215,8 +215,8 @@ impl FlowContext {
 pub(crate) enum DestinationType {
     VPort           = 0x0,
     FlowTable       = 0x1,
-    TIR             = 0x2,
-    QP              = 0x3,
+    Tir             = 0x2,
+    Qp              = 0x3,
     FlowSampler     = 0x6,
 }
 
@@ -226,7 +226,7 @@ pub(crate) enum DestinationType {
 #[derive(FromBytes, Default)]
 #[repr(C, packed)]
 pub(crate) struct DestinationEntry {
-    /// currently we only set the type to [DestinationType::TIR] and the id is the TIR number for the RQ
+    /// currently we only set the type to [DestinationType::Tir] and the id is the TIR number for the RQ
     pub(crate) id_and_type:                Volatile<U32<BigEndian>>,
     pub(crate) packet_reformat:                 Volatile<U32<BigEndian>>,
 
diff --git a/kernel/mod_mgmt/src/lib.rs b/kernel/mod_mgmt/src/lib.rs
index 358348138f..f0aea7b692 100644
--- a/kernel/mod_mgmt/src/lib.rs
+++ b/kernel/mod_mgmt/src/lib.rs
@@ -2698,7 +2698,7 @@ impl CrateNamespace {
     ) -> Option<WeakSectionRef> {
         // Some symbols may have multiple potential containing crates, so we try to load each one to find the missing symbol.
         for potential_crate_name in get_containing_crate_name(demangled_full_symbol) {
-            let potential_crate_name = format!("{}-", potential_crate_name);
+            let potential_crate_name = format!("{potential_crate_name}-");
  
             // Try to find and load the missing crate object file from this namespace's directory or its recursive namespace's directory,
             // (or from the backup namespace's directory set).
@@ -2849,7 +2849,7 @@ impl CrateNamespace {
 
         if let Some(ref r_ns) = self.recursive_namespace {
             let syms_recursive = r_ns.dump_symbol_map_recursive();
-            syms = format!("{}\n{}", syms, syms_recursive);
+            syms = format!("{syms}\n{syms_recursive}");
         }
 
         syms
@@ -2997,7 +2997,7 @@ fn dump_dependent_crates(krate: &LoadedCrate, prefix: String) {
 		let strong_crate_ref = weak_crate_ref.upgrade().unwrap();
         let strong_crate = strong_crate_ref.lock_as_ref();
 		debug!("{}{}", prefix, strong_crate.crate_name);
-		dump_dependent_crates(&strong_crate, format!("{}  ", prefix));
+		dump_dependent_crates(&strong_crate, format!("{prefix}  "));
 	}
 }
 
@@ -3009,7 +3009,7 @@ fn dump_weak_dependents(sec: &LoadedSection, prefix: String) {
 		debug!("{}Section \"{}\": sections dependent on me (weak dependents):", prefix, sec.name);
 		for weak_dep in &sec_inner.sections_dependent_on_me {
 			if let Some(wds) = weak_dep.section.upgrade() {
-				let prefix = format!("{}  ", prefix); // add two spaces of indentation to the prefix
+				let prefix = format!("{prefix}  "); // add two spaces of indentation to the prefix
 				dump_weak_dependents(&wds, prefix);
 			}
 			else {
diff --git a/kernel/mutex_preemption/src/rwlock_preempt.rs b/kernel/mutex_preemption/src/rwlock_preempt.rs
index 5b390c0ca6..3c40489548 100644
--- a/kernel/mutex_preemption/src/rwlock_preempt.rs
+++ b/kernel/mutex_preemption/src/rwlock_preempt.rs
@@ -94,10 +94,7 @@ impl<T: ?Sized> RwLockPreempt<T> {
     /// ```
     pub fn read(&self) -> RwLockPreemptReadGuard<T> {
         loop {
-            match self.try_read() {
-                Some(guard) => return guard,
-                _ => {}
-            }
+            if let Some(guard) = self.try_read() { return guard }
         }
     }
 
@@ -189,10 +186,7 @@ impl<T: ?Sized> RwLockPreempt<T> {
     /// ```
     pub fn write(&self) -> RwLockPreemptWriteGuard<T> {
         loop {
-            match self.try_write() {
-                Some(guard) => return guard,
-                _ => {}
-            }
+            if let Some(guard) = self.try_write() { return guard }
         }
     }
 
diff --git a/kernel/nano_core/build.rs b/kernel/nano_core/build.rs
index 96caae7380..71eadd0473 100644
--- a/kernel/nano_core/build.rs
+++ b/kernel/nano_core/build.rs
@@ -81,11 +81,11 @@ fn emit_built_rs_file() {
     for (k, v) in std::env::vars() {
         if k.starts_with("CARGO_CFG_") && !NON_CUSTOM_CFGS.contains(&k.as_str()) {
             let key = k[CARGO_CFG_PREFIX.len()..].to_lowercase();
-            custom_cfgs = format!("{}(\"{}\", \"{}\"), ", custom_cfgs, key, v);
+            custom_cfgs = format!("{custom_cfgs}(\"{key}\", \"{v}\"), ");
 
             custom_cfgs_str.push_str(&key);
             if !v.is_empty() {
-                write!(custom_cfgs_str, "=\"{}\"", v).expect("Failed to write to custom_cfgs_str");
+                write!(custom_cfgs_str, "=\"{v}\"").expect("Failed to write to custom_cfgs_str");
             }
             custom_cfgs_str.push(' ');
 
@@ -96,16 +96,13 @@ fn emit_built_rs_file() {
     // Append all of the custom cfg values to the built.rs file as an array.
     write!(
         &mut built_file,
-        "#[allow(dead_code)]\npub const CUSTOM_CFG: [(&str, &str); {}] = [{}];\n",
-        num_custom_cfgs,
-        custom_cfgs,
+        "#[allow(dead_code)]\npub const CUSTOM_CFG: [(&str, &str); {num_custom_cfgs}] = [{custom_cfgs}];\n",
     ).unwrap();
 
     // Append all of the custom cfg values to the built.rs file as a single string.
     write!(
         &mut built_file,
-        "#[allow(dead_code)]\npub const CUSTOM_CFG_STR: &str = r#\"{}\"#;\n",
-        custom_cfgs_str,
+        "#[allow(dead_code)]\npub const CUSTOM_CFG_STR: &str = r#\"{custom_cfgs_str}\"#;\n",
     ).unwrap();
 }
 
@@ -119,7 +116,7 @@ fn compile_asm() {
     .join(BOOT_SPECIFICATION);
     if let Err(e) = std::fs::create_dir_all(&out_dir) {
         if e.kind() != std::io::ErrorKind::AlreadyExists {
-            panic!("failed to create compiled_asm directory: {}", e);
+            panic!("failed to create compiled_asm directory: {e}");
         }
     }
     let include_path = PathBuf::from(env::var("CARGO_MANIFEST_DIR").unwrap())
@@ -156,7 +153,7 @@ fn compile_asm() {
         let file = file.expect("failed to read asm file");
         if file
             .file_type()
-            .unwrap_or_else(|_| panic!("couldn't get file type of {:?}", file))
+            .unwrap_or_else(|_| panic!("couldn't get file type of {file:?}"))
             .is_file()
         {
             assert_eq!(file.path().extension(), Some("asm".as_ref()),
diff --git a/kernel/ota_update_client/src/lib.rs b/kernel/ota_update_client/src/lib.rs
index 2efdfe8eac..d44f2ce84f 100644
--- a/kernel/ota_update_client/src/lib.rs
+++ b/kernel/ota_update_client/src/lib.rs
@@ -126,7 +126,7 @@ pub fn download_listing(
     remote_endpoint: IpEndpoint,
     update_build: &str,
 ) -> Result<Vec<String>, &'static str> {
-    download_string_file(iface, remote_endpoint, &format!("/{}/{}", update_build, LISTING_FILE_NAME))
+    download_string_file(iface, remote_endpoint, &format!("/{update_build}/{LISTING_FILE_NAME}"))
 }
 
 
@@ -138,7 +138,7 @@ pub fn download_diff(
     remote_endpoint: IpEndpoint,
     update_build: &str,
 ) -> Result<Vec<String>, &'static str> {
-    download_string_file(iface, remote_endpoint, &format!("/{}/{}", update_build, DIFF_FILE_NAME))
+    download_string_file(iface, remote_endpoint, &format!("/{update_build}/{DIFF_FILE_NAME}"))
 }
 
 
@@ -249,8 +249,8 @@ pub fn download_crates(
 
     let mut paths_to_download: Vec<String> = Vec::new();
     for file_name in crates.iter() {
-        let path = format!("/{}/{}", update_build, file_name);
-        let path_sha = format!("/{}/{}/{}{}", update_build, CHECKSUMS_DIR_NAME, file_name, CHECKSUM_FILE_EXTENSION);
+        let path = format!("/{update_build}/{file_name}");
+        let path_sha = format!("/{update_build}/{CHECKSUMS_DIR_NAME}/{file_name}{CHECKSUM_FILE_EXTENSION}");
         paths_to_download.push(path);
         paths_to_download.push(path_sha);
     }
@@ -461,5 +461,5 @@ fn download_files<S: AsRef<str>>(
 /// The `hash` string must be 64 hexadecimal characters, otherwise `false` will be returned. 
 fn verify_hash(content: &[u8], hash: &str) -> bool {
     let result = Sha3_512::digest(content);
-    hash == format!("{:x}", result)
+    hash == format!("{result:x}")
 }
diff --git a/kernel/pci/src/lib.rs b/kernel/pci/src/lib.rs
index 3a522a2e72..2afabd910a 100644
--- a/kernel/pci/src/lib.rs
+++ b/kernel/pci/src/lib.rs
@@ -323,7 +323,7 @@ impl fmt::Display for PciLocation {
 
 impl fmt::Debug for PciLocation {
     fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
-        write!(f, "{}", self)
+        write!(f, "{self}")
     }
 }
 
diff --git a/kernel/pmu_x86/src/lib.rs b/kernel/pmu_x86/src/lib.rs
index 82adf6ce42..895a6483b4 100644
--- a/kernel/pmu_x86/src/lib.rs
+++ b/kernel/pmu_x86/src/lib.rs
@@ -46,11 +46,11 @@
 //! 
 //! if let Ok(my_sampler) = sampler {
 //! 
-//! 	// wait some time here
-//! 	
-//! 	if let Ok(mut samples) = pmu_x86::retrieve_samples() {
-//! 		pmu_x86::print_samples(&mut samples);
-//! 	}
+//!     // wait some time here
+//!     
+//!     if let Ok(mut samples) = pmu_x86::retrieve_samples() {
+//!         pmu_x86::print_samples(&mut samples);
+//!     }
 //! }
 //! ```
 //!
diff --git a/kernel/runqueue_priority/src/lib.rs b/kernel/runqueue_priority/src/lib.rs
index 25e8a31284..c68addc70a 100644
--- a/kernel/runqueue_priority/src/lib.rs
+++ b/kernel/runqueue_priority/src/lib.rs
@@ -74,7 +74,7 @@ impl PriorityTaskRef {
     }
 
     /// Increment the number of times the task is picked
-    pub fn increment_context_switches(&mut self) -> (){
+    pub fn increment_context_switches(&mut self) {
         self.context_switches = self.context_switches.saturating_add(1);
     }
 }
diff --git a/kernel/runqueue_realtime/src/lib.rs b/kernel/runqueue_realtime/src/lib.rs
index 853ddaa924..cf71fdd5bb 100644
--- a/kernel/runqueue_realtime/src/lib.rs
+++ b/kernel/runqueue_realtime/src/lib.rs
@@ -281,14 +281,11 @@ impl RunQueue {
         task: &TaskRef, 
         period: usize
     ) -> Result<(), &'static str> {
-        match self.iter().position(|rt| rt.taskref == *task ) {
-            Some(i) => {
-                if let Some(mut realtime_taskref) = self.remove(i) {
-                    realtime_taskref.period = Some(period);
-                    self.insert_realtime_taskref_at_proper_location(realtime_taskref);
-                }
-            },
-            None => {},
+        if let Some(i) = self.iter().position(|rt| &rt.taskref == task) {
+            if let Some(mut realtime_taskref) = self.remove(i) {
+                realtime_taskref.period = Some(period);
+                self.insert_realtime_taskref_at_proper_location(realtime_taskref);
+            }
         };
         Ok(())
     }
diff --git a/kernel/serial_port/src/lib.rs b/kernel/serial_port/src/lib.rs
index fac3829363..a0aaf5fc7b 100644
--- a/kernel/serial_port/src/lib.rs
+++ b/kernel/serial_port/src/lib.rs
@@ -171,7 +171,7 @@ impl SerialPort {
             interrupt_handler,
             serial_port_receive_deferred,
             serial_port,
-            Some(format!("serial_port_deferred_task_irq_{:#X}", interrupt_number)),
+            Some(format!("serial_port_deferred_task_irq_{interrupt_number:#X}")),
         );
 
         match registration_result {
diff --git a/kernel/smoltcp_helper/src/lib.rs b/kernel/smoltcp_helper/src/lib.rs
index 180e88805b..de05d96a5c 100644
--- a/kernel/smoltcp_helper/src/lib.rs
+++ b/kernel/smoltcp_helper/src/lib.rs
@@ -80,7 +80,7 @@ pub fn connect(
     let start = hpet_ticks!();
     
     debug!("smoltcp_helper: connecting from {}:{} to {} ...",
-        iface.lock().ip_addrs().get(0).map(|ip| format!("{}", ip)).unwrap_or_else(|| "ERROR".to_string()),
+        iface.lock().ip_addrs().get(0).map(|ip| format!("{ip}")).unwrap_or_else(|| "ERROR".to_string()),
         local_port, 
         remote_endpoint,
     );
diff --git a/kernel/spawn/src/lib.rs b/kernel/spawn/src/lib.rs
index c96b752c48..e82f50e393 100755
--- a/kernel/spawn/src/lib.rs
+++ b/kernel/spawn/src/lib.rs
@@ -1000,7 +1000,7 @@ pub fn create_idle_task() -> Result<JoinableTaskRef, &'static str> {
     debug!("Spawning a new idle task on core {}", apic_id);
 
     new_task_builder(idle_task_entry, apic_id)
-        .name(format!("idle_task_core_{}", apic_id))
+        .name(format!("idle_task_core_{apic_id}"))
         .idle(apic_id)
         .spawn_restartable(None)
 }
diff --git a/kernel/stack_trace_frame_pointers/build.rs b/kernel/stack_trace_frame_pointers/build.rs
index 2c27f66361..042a223ba2 100644
--- a/kernel/stack_trace_frame_pointers/build.rs
+++ b/kernel/stack_trace_frame_pointers/build.rs
@@ -14,7 +14,7 @@ fn main() {
     if let Ok(rustflags) = std::env::var("CARGO_ENCODED_RUSTFLAGS") {
         if rustflags.contains("force-frame-pointers=yes")
         || rustflags.contains("force-frame-pointers=true") {
-            println!("{}frame pointers", CFG_PREFIX);
+            println!("{CFG_PREFIX}frame pointers");
         }
     } else {
         eprintln!("Note: CARGO_ENCODED_RUSTFLAGS env var did not exist.");
diff --git a/kernel/task/src/lib.rs b/kernel/task/src/lib.rs
index 8648f02f6a..a278372991 100755
--- a/kernel/task/src/lib.rs
+++ b/kernel/task/src/lib.rs
@@ -98,7 +98,7 @@ impl fmt::Display for PanicInfoOwned {
 impl<'p> From<&PanicInfo<'p>> for PanicInfoOwned {
     fn from(info: &PanicInfo) -> PanicInfoOwned {
         let msg = info.message()
-            .map(|m| format!("{}", m))
+            .map(|m| format!("{m}"))
             .unwrap_or_default();
         let (file, line, column) = if let Some(loc) = info.location() {
             (String::from(loc.file()), loc.line(), loc.column())
@@ -181,8 +181,8 @@ impl fmt::Display for KillReason {
     fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
         match self {
             Self::Requested         => write!(f, "Requested"),
-            Self::Panic(panic_info) => write!(f, "Panicked at {}", panic_info),
-            Self::Exception(num)    => write!(f, "Exception {:#X}({})", num, num),
+            Self::Panic(panic_info) => write!(f, "Panicked at {panic_info}"),
+            Self::Exception(num)    => write!(f, "Exception {num:#X}({num})"),
         }
     }
 }
@@ -498,7 +498,7 @@ impl Task {
                 waker: None,
             }),
             id: task_id,
-            name: format!("task_{}", task_id),
+            name: format!("task_{task_id}"),
             running_on_cpu: AtomicCell::new(None.into()),
             runstate: AtomicCell::new(RunState::Initing),
             suspended: AtomicBool::new(false),
@@ -1463,7 +1463,7 @@ pub fn bootstrap_task(
         None,
         bootstrap_task_cleanup_failure,
     );
-    bootstrap_task.name = format!("bootstrap_task_core_{}", apic_id);
+    bootstrap_task.name = format!("bootstrap_task_core_{apic_id}");
     bootstrap_task.runstate.store(RunState::Runnable);
     bootstrap_task.running_on_cpu.store(Some(apic_id).into()); 
     bootstrap_task.inner.get_mut().pinned_core = Some(apic_id); // can only run on this CPU core
diff --git a/kernel/task_fs/src/lib.rs b/kernel/task_fs/src/lib.rs
index 21dd9b2970..36208244d8 100644
--- a/kernel/task_fs/src/lib.rs
+++ b/kernel/task_fs/src/lib.rs
@@ -126,7 +126,7 @@ impl Directory for TaskFs {
     fn list(&self) -> Vec<String> {
         let mut tasks_string = Vec::new();
         for (id, _taskref) in TASKLIST.lock().iter() {
-            tasks_string.push(format!("{}", id));
+            tasks_string.push(format!("{id}"));
         }
         tasks_string
     }
@@ -158,7 +158,7 @@ impl TaskDir {
         let task_id = taskref.id;
         let directory = TaskDir {
             name,
-            path: Path::new(format!("{}/{}", TASKS_DIRECTORY_PATH, task_id)),
+            path: Path::new(format!("{TASKS_DIRECTORY_PATH}/{task_id}")),
             taskref,
             parent: Arc::clone(parent),
         };
@@ -230,15 +230,15 @@ impl TaskFile {
         TaskFile {
             taskref,
             task_id,
-            path: Path::new(format!("{}/{}/task_info", TASKS_DIRECTORY_PATH, task_id)), 
+            path: Path::new(format!("{TASKS_DIRECTORY_PATH}/{task_id}/task_info")), 
         }
     }
 
     /// Generates the task info string.
     fn generate(&self) -> String {
         // Print all tasks
-        let cpu = self.taskref.running_on_cpu().map(|cpu| format!("{}", cpu)).unwrap_or_else(|| String::from("-"));
-        let pinned = &self.taskref.pinned_core().map(|pin| format!("{}", pin)).unwrap_or_else(|| String::from("-"));
+        let cpu = self.taskref.running_on_cpu().map(|cpu| format!("{cpu}")).unwrap_or_else(|| String::from("-"));
+        let pinned = &self.taskref.pinned_core().map(|pin| format!("{pin}")).unwrap_or_else(|| String::from("-"));
         let task_type = if self.taskref.is_an_idle_task {
             "I"
         } else if self.taskref.is_application() {
@@ -331,7 +331,7 @@ impl MmiDir {
         MmiDir {
             taskref,
             task_id,
-            path: Path::new(format!("{}/{}/mmi", TASKS_DIRECTORY_PATH, task_id)),
+            path: Path::new(format!("{TASKS_DIRECTORY_PATH}/{task_id}/mmi")),
         }
     }
 }
@@ -400,7 +400,7 @@ impl MmiFile {
         MmiFile {
             taskref,
             task_id,
-            path: Path::new(format!("{}/{}/mmi/MmiInfo", TASKS_DIRECTORY_PATH, task_id)), 
+            path: Path::new(format!("{TASKS_DIRECTORY_PATH}/{task_id}/mmi/MmiInfo")), 
         }
     }
 
diff --git a/kernel/text_terminal/src/lib.rs b/kernel/text_terminal/src/lib.rs
index 0205bc1ac7..2985e30b6c 100644
--- a/kernel/text_terminal/src/lib.rs
+++ b/kernel/text_terminal/src/lib.rs
@@ -917,8 +917,8 @@ impl<'term, Backend: TerminalBackend> TerminalActionHandler<'term, Backend> {
 
         // TODO: handle scroll action
 
-        let new_scrollback_position = self.screen_cursor.position.to_scrollback_point(
-            // TODO: after `to_scrollback_point()` supports backwards navigation from a point below the current screen point,
+        let new_scrollback_position = self.screen_cursor.position.as_scrollback_point(
+            // TODO: after `as_scrollback_point()` supports backwards navigation from a point below the current screen point,
             //       then we can use the original positions. But since it doesn't support that, we must use the current scroll position.
             //
             // (orig_scrollback_position, orig_screen_position),
@@ -956,7 +956,7 @@ impl<'term, Backend: TerminalBackend> TerminalActionHandler<'term, Backend> {
 
         // TODO: handle scroll action
 
-        let new_scrollback_position = self.screen_cursor.position.to_scrollback_point(
+        let new_scrollback_position = self.screen_cursor.position.as_scrollback_point(
             (orig_scrollback_position, orig_screen_position),
             self.scrollback_buffer,
             screen_size
@@ -1268,8 +1268,8 @@ impl Character {
 impl fmt::Display for Character {
     fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         match &self {
-            Character::Single(c) => write!(f, "{}", c),
-            Character::Multi(s)  => write!(f, "{}", s),
+            Character::Single(c) => write!(f, "{c}"),
+            Character::Multi(s)  => write!(f, "{s}"),
         }
     }
 }
@@ -1411,7 +1411,7 @@ impl ScreenPoint {
     /// this returns a `ScrollbackBufferPoint` based on the assumption that 
     /// sufficient empty lines (that occupy one row each) and empty units (that occupy one column each) 
     /// would be inserted into the scrollback buffer.
-    fn to_scrollback_point(
+    fn as_scrollback_point(
         &self,
         known_prior_point: (ScrollbackBufferPoint, ScreenPoint), 
         scrollback_buffer: &ScrollbackBuffer,
@@ -1435,13 +1435,13 @@ impl ScreenPoint {
             let additional_rows = end_row.saturating_sub(start_row);
             row += additional_rows;
 
-            trace!("to_scrollback_point(): {:?}: start_row: {:?}, last_unit: {:?}, end_row: {:?}, additional_rows: {:?}, row: {:?}, target_row: {:?}", 
+            trace!("as_scrollback_point(): {:?}: start_row: {:?}, last_unit: {:?}, end_row: {:?}, additional_rows: {:?}, row: {:?}, target_row: {:?}", 
                 line_idx, start_row, last_unit, end_row, additional_rows, row, target_row
             );
 
             if row >= target_row {
                 let row_overshoot = row - target_row;
-                trace!("to_scrollback_point(): row_overshoot: {:?}", row_overshoot);
+                trace!("as_scrollback_point(): row_overshoot: {:?}", row_overshoot);
                 unit_idx = UnitIndex(last_unit.saturating_sub(row_overshoot * screen_width));
                 break;
             }
@@ -1452,14 +1452,14 @@ impl ScreenPoint {
             unit_idx = UnitIndex(0);
         }
 
-        trace!("to_scrollback_point(): after iterating, row: {:?}, target_row: {:?}, line_idx: {:?}", row, target_row, line_idx);
+        trace!("as_scrollback_point(): after iterating, row: {:?}, target_row: {:?}, line_idx: {:?}", row, target_row, line_idx);
 
         if row < target_row {
             // The scrollback buffer didn't have enough lines.
             // Currently, `line_idx` is right after the last line.
             // We calculate the target line index as: `line_idx - 1 + (target_row - row)`.
             let target_line = line_idx.0.saturating_add(target_row).saturating_sub(row).saturating_sub(1);
-            trace!("to_scrollback_point(): target_line: {:?}", target_line);
+            trace!("as_scrollback_point(): target_line: {:?}", target_line);
             ScrollbackBufferPoint {
                 line_idx: LineIndex(target_line),
                 unit_idx: UnitIndex(target_column),
@@ -1735,7 +1735,7 @@ enum ScreenToScrollbackConversion {
     ClosestPrevious(ScrollbackBufferPoint, ScreenPoint),
 }
 impl ScreenToScrollbackConversion {
-    fn to_option(self) -> Option<ScrollbackBufferPoint> {
+    fn into_option(self) -> Option<ScrollbackBufferPoint> {
         match self {
             Self::ExactMatch(sbp) => Some(sbp),
             _ => None,
diff --git a/kernel/unwind/src/registers.rs b/kernel/unwind/src/registers.rs
index d9eb4821fc..36624e89d0 100644
--- a/kernel/unwind/src/registers.rs
+++ b/kernel/unwind/src/registers.rs
@@ -43,7 +43,7 @@ impl Debug for Registers {
         for (i, reg) in self.registers.iter().enumerate() {
             match *reg {
                 None => { } // write!(fmt, "[{}]: None, ", i)?,
-                Some(r) => write!(fmt, "[{}]: {:#X}, ", i, r)?,
+                Some(r) => write!(fmt, "[{i}]: {r:#X}, ")?,
             }
         }
         Ok(())
diff --git a/kernel/wasi_interpreter/src/lib.rs b/kernel/wasi_interpreter/src/lib.rs
index 8edaf9fa73..3441239ecc 100644
--- a/kernel/wasi_interpreter/src/lib.rs
+++ b/kernel/wasi_interpreter/src/lib.rs
@@ -107,7 +107,7 @@ pub fn execute_binary(wasm_binary: Vec<u8>, args: Vec<String>, preopen_dirs: Vec
     ).expect("couldn't get current task");
 
     let mut theseus_env_vars: Vec<String> = Vec::new();
-    theseus_env_vars.push(format!("PWD={}", pwd));
+    theseus_env_vars.push(format!("PWD={pwd}"));
 
     // Construct initial host externals.
     let mut ext: HostExternals = HostExternals {
diff --git a/kernel/wasi_interpreter/src/wasmi_state_machine.rs b/kernel/wasi_interpreter/src/wasmi_state_machine.rs
index 7b60d176fe..a3e0f98f51 100644
--- a/kernel/wasi_interpreter/src/wasmi_state_machine.rs
+++ b/kernel/wasi_interpreter/src/wasmi_state_machine.rs
@@ -71,10 +71,9 @@ impl ProcessStateMachine {
                 let index = match closure(module_name, field_name, signature) {
                     Ok(i) => i,
                     Err(_) => {
-                        return Err(wasmi::Error::Instantiation(format!(
-                            "Couldn't resolve `{}`:`{}`",
-                            module_name, field_name
-                        )))
+                        return Err(wasmi::Error::Instantiation(
+                            format!("Couldn't resolve `{module_name}`:`{field_name}`")
+                        ))
                     }
                 };
 
diff --git a/kernel/window_manager/src/lib.rs b/kernel/window_manager/src/lib.rs
index 6c13bbebc0..39d4ec8103 100644
--- a/kernel/window_manager/src/lib.rs
+++ b/kernel/window_manager/src/lib.rs
@@ -123,19 +123,11 @@ impl WindowManager {
             None => true,
         };
         
-        match self.is_window_in_show_list(inner_ref) {
-            // remove item in current list
-            Some(i) => {
-                self.show_list.remove(i);
-            }
-            None => {}
+        if let Some(i) = self.is_window_in_show_list(inner_ref) {
+            self.show_list.remove(i);
         }
-        match self.is_window_in_hide_list(inner_ref) {
-            // remove item in current list
-            Some(i) => {
-                self.hide_list.remove(i);
-            }
-            None => {}
+        if let Some(i) = self.is_window_in_hide_list(inner_ref) {
+            self.hide_list.remove(i);
         }
         self.active = Arc::downgrade(inner_ref);
         let area = {
@@ -402,12 +394,9 @@ impl WindowManager {
         new_border: Rectangle,
     ) -> Result<(), &'static str> {
         // first clear old border if exists
-        match self.repositioned_border {
-            Some(border) => {
-                let pixels = self.draw_floating_border(&border, color::TRANSPARENT);
-                self.refresh_bottom_windows(pixels.into_iter(), true)?;
-            },
-            None =>{}
+        if let Some(border) = self.repositioned_border {
+            let pixels = self.draw_floating_border(&border, color::TRANSPARENT);
+            self.refresh_bottom_windows(pixels.into_iter(), true)?;
         }
 
         // then draw current border
diff --git a/lints.txt b/lints.txt
deleted file mode 100644
index cab36a1042..0000000000
--- a/lints.txt
+++ /dev/null
@@ -1,344 +0,0 @@
-complexity
-bind-instead-of-map
-bool-comparison
-borrowed-box
-bytes-count-to-len
-char-lit-as-u8
-clone-on-copy
-crosspointer-transmute
-deprecated-cfg-attr
-deref-addrof
-derivable-impls
-diverging-sub-expression
-double-comparisons
-double-parens
-duration-subsec
-explicit-counter-loop
-explicit-write
-extra-unused-lifetimes
-filter-map-identity
-filter-next
-flat-map-identity
-get-last-with-len
-identity-op
-inspect-for-each
-int-plus-one
-iter-count
-manual-filter-map
-manual-find-map
-manual-flatten
-manual-split-once
-manual-strip
-manual-swap
-manual-unwrap-or
-map-flatten
-map-identity
-match-as-ref
-match-single-binding
-needless-arbitrary-self-type
-needless-bool
-needless-borrowed-reference
-needless-lifetimes
-needless-match
-needless-option-as-deref
-needless-option-take
-needless-question-mark
-needless-splitn
-needless-update
-neg-cmp-op-on-partial-ord
-no-effect
-nonminimal-bool
-option-as-ref-deref
-option-filter-map
-option-map-unit-fn
-or-then-unwrap
-overflow-check-conditional
-partialeq-ne-impl
-precedence
-ptr-offset-with-cast
-range-zip-with-len
-redundant-closure-call
-redundant-slicing
-repeat-once
-result-map-unit-fn
-search-is-some
-short-circuit-statement
-single-element-loop
-skip-while-next
-string-from-utf8-as-bytes
-strlen-on-c-strings
-temporary-assignment
-too-many-arguments
-transmute-bytes-to-str
-transmute-float-to-int
-transmute-int-to-bool
-transmute-int-to-char
-transmute-int-to-float
-transmute-num-to-bytes
-transmute-ptr-to-ref
-transmutes-expressible-as-ptr-casts
-type-complexity
-unit-arg
-unnecessary-cast
-unnecessary-filter-map
-unnecessary-find-map
-unnecessary-operation
-unnecessary-sort-by
-unnecessary-unwrap
-unneeded-wildcard-pattern
-useless-asref
-useless-conversion
-useless-format
-vec-box
-while-let-loop
-wildcard-in-or-patterns
-zero-divided-by-zero
-zero-prefixed-literal
-correctness
-absurd-extreme-comparisons
-almost-swapped
-approx-constant
-async-yields-async
-bad-bit-mask
-cast-ref-to-mut
-cast-slice-different-sizes
-clone-double-ref
-cmp-nan
-deprecated-semver
-derive-hash-xor-eq
-derive-ord-xor-partial-ord
-drop-copy
-drop-ref
-enum-clike-unportable-variant
-eq-op
-erasing-op
-fn-address-comparisons
-forget-copy
-forget-ref
-if-let-mutex
-if-same-then-else
-ifs-same-cond
-ineffective-bit-mask
-infinite-iter
-inherent-to-string-shadow-display
-inline-fn-without-body
-invalid-null-ptr-usage
-invalid-regex
-invisible-characters
-iter-next-loop
-iterator-step-by-zero
-let-underscore-lock
-match-str-case-mismatch
-mem-replace-with-uninit
-min-max
-mismatched-target-os
-mistyped-literal-suffixes
-modulo-one
-mut-from-ref
-never-loop
-non-octal-unix-permissions
-nonsensical-open-options
-not-unsafe-ptr-arg-deref
-option-env-unwrap
-out-of-bounds-indexing
-overly-complex-bool-expr
-panicking-unwrap
-possible-missing-comma
-recursive-format-impl
-reversed-empty-ranges
-self-assignment
-serde-api-misuse
-size-of-in-element-count
-suspicious-splitn
-transmuting-null
-undropped-manually-drops
-uninit-assumed-init
-uninit-vec
-unit-cmp
-unit-hash
-unit-return-expecting-ord
-unsound-collection-transmute
-unused-io-amount
-useless-attribute
-vec-resize-to-zero
-vtable-address-comparisons
-while-immutable-condition
-wrong-transmute
-zst-offset
-# Style
-assertions-on-constants
-assign-op-pattern
-disallowed-names
-blocks-in-if-conditions
-bool-assert-comparison
-borrow-interior-mutable-const
-builtin-type-shadow
-bytes-nth
-chars-last-cmp
-chars-next-cmp
-cmp-null
-collapsible-else-if
-collapsible-if
-collapsible-match
-comparison-chain
-comparison-to-empty
-declare-interior-mutable-const
-disallowed-methods
-disallowed-types
-double-must-use
-double-neg
-duplicate-underscore-argument
-enum-variant-names
-err-expect
-excessive-precision
-field-reassign-with-default
-fn-to-numeric-cast
-fn-to-numeric-cast-with-truncation
-for-kv-map
-from-over-into
-from-str-radix-10
-inconsistent-digit-grouping
-infallible-destructuring-match
-inherent-to-string
-init-numbered-fields
-into-iter-on-ref
-is-digit-ascii-radix
-iter-cloned-collect
-iter-next-slice
-iter-nth-zero
-iter-skip-next
-just-underscores-and-digits
-len-without-is-empty
-len-zero
-let-and-return
-let-unit-value
-main-recursion
-manual-async-fn
-manual-bits
-manual-map
-manual-non-exhaustive
-manual-range-contains
-manual-saturating-arithmetic
-map-clone
-map-collect-result-unit
-match-like-matches-macro
-match-overlapping-arm
-match-ref-pats
-match-result-ok
-mem-replace-option-with-none
-mem-replace-with-default
-missing-safety-doc
-mixed-case-hex-literals
-module-inception
-must-use-unit
-mut-mutex-lock
-needless-borrow
-needless-doctest-main
-needless-late-init
-needless-range-loop
-needless-return
-neg-multiply
-new-ret-no-self
-new-without-default
-ok-expect
-op-ref
-option-map-or-none
-print-literal
-print-with-newline
-println-empty-string
-ptr-arg
-ptr-eq
-question-mark
-redundant-closure
-redundant-field-names
-redundant-pattern
-redundant-pattern-matching
-redundant-static-lifetimes
-result-map-or-into-option
-result-unit-err
-same-item-push
-self-named-constructors
-should-implement-trait
-single-char-add-str
-single-component-path-imports
-# single-match
-string-extend-chars
-# tabs-in-doc-comments
-to-digit-is-some
-toplevel-ref-arg
-trim-split-whitespace
-unnecessary-fold
-# unnecessary-lazy-evaluations
-# unnecessary-mut-passed
-unnecessary-owned-empty-strings
-unsafe-removed-from-name
-# unused-unit
-unusual-byte-groupings
-unwrap-or-else-default
-# upper-case-acronyms
-while-let-on-iterator
-write-literal
-write-with-newline
-writeln-empty-string
-# wrong-self-convention
-zero-ptr
-# Nursery
-empty-line-after-outer-attr
-fallible-impl-from
-mutex-integer
-needless-borrow
-panicking-unwrap
-range-plus-one
-unnecessary-unwrap
-perf
-box-collection
-boxed-local
-cmp-owned
-expect-fun-call
-extend-with-drain
-format-in-format-args
-format-push-string
-iter-nth
-iter-overeager-cloned
-large-const-arrays
-large-enum-variant
-manual-memcpy
-manual-str-repeat
-map-entry
-missing-spin-loop
-needless-collect
-or-fun-call
-redundant-allocation
-redundant-clone
-single-char-pattern
-slow-vector-initialization
-to-string-in-format-args
-unnecessary-to-owned
-useless-vec
-vec-init-then-push
-suspicious
-await-holding-invalid-type
-await-holding-lock
-await-holding-refcell-ref
-blanket-clippy-restriction-lints
-cast-abs-to-unsigned
-cast-enum-constructor
-cast-enum-truncation
-crate-in-macro-def
-drop-non-drop
-empty-loop
-float-equality-without-abs
-for-loops-over-fallibles
-forget-non-drop
-misrefactored-assign-op
-mixed-read-write-in-expression
-mut-range-bound
-mutable-key-type
-octal-escapes
-print-in-format-impl
-suspicious-arithmetic-impl
-suspicious-assignment-formatting
-suspicious-else-formatting
-suspicious-map
-suspicious-op-assign-impl
-suspicious-unary-op-formatting


Test patch: