fix: Use const &[&str] instead of Vec<String>
@@ -761,9 +761,7 @@ fn get_themes(&mut self, ctx: &mut EventCtx, config: &Config) {
#[allow(unused_variables)]
fn get_commands(&mut self, ctx: &mut EventCtx) {
- let excluded_items: Vec<String> = vec![
- String::from("palette.command")
- ];
+ const EXCLUDED_ITEMS: &[&str] = &["palette.command"];
let palette = Arc::make_mut(&mut self.palette);
palette.items = self
@@ -771,7 +769,7 @@ fn get_commands(&mut self, ctx: &mut EventCtx) {
.commands
.iter()
.filter_map(|(_, c)| {
- if excluded_items.contains(&c.cmd) {
+ if EXCLUDED_ITEMS.contains(&c.cmd.as_str()) {
return None;
}
