mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-05 16:21:15 -03:00
Fix some clipplies
This commit is contained in:
@@ -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?
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user