Fix some clipplies

This commit is contained in:
Peter Ammon
2025-10-31 17:36:49 -07:00
parent 819759840e
commit c66fa682e9
3 changed files with 7 additions and 16 deletions

View File

@@ -212,7 +212,7 @@ pub fn clear(&mut self) {
/// This is exposed for testing.
#[cfg(test)]
fn invalidate_cache(&mut self) {
self.cache = Box::new(AutoloadFileCache::with_dirs(self.cache.dirs().to_owned()));
*self.cache = AutoloadFileCache::with_dirs(self.cache.dirs().to_owned());
}
/// Like resolve_autoload(), but accepts the paths directly.
@@ -227,7 +227,7 @@ fn resolve_command_impl(&mut self, cmd: &wstr, paths: &[WString]) -> AutoloadRes
// Note we don't have to modify autoloadable_files_. We'll naturally detect if those have
// changed when we query the cache.
if paths != self.cache.dirs() {
self.cache = Box::new(AutoloadFileCache::with_dirs(paths.to_owned()));
*self.cache = AutoloadFileCache::with_dirs(paths.to_owned());
}
// Do we have an entry to load?

View File

@@ -3,19 +3,14 @@
// Implementation of the block builtin.
use super::prelude::*;
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
enum Scope {
#[default]
Unset,
Global,
Local,
}
impl Default for Scope {
fn default() -> Self {
Self::Unset
}
}
#[derive(Debug, Clone, Copy, Default)]
struct Options {
scope: Scope,

View File

@@ -1212,17 +1212,13 @@ fn get_fallback(role: HighlightRole) -> HighlightRole {
}
}
impl Default for HighlightRole {
fn default() -> Self {
Self::normal
}
}
/// Describes the role of a span of text.
#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
#[repr(u8)]
#[derive(Default)]
pub enum HighlightRole {
normal, // normal text
#[default]
normal, // normal text
error, // error
command, // command
keyword,