mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-03-30 14:12:21 +02:00
fix(wm): dynamically reserve monitor ring space
This commit makes a small change to dynamically keep reserving space in the VecDeque that backs Ring<Monitor> until an index preference can be contained within the current length. This commit also fixes some clippy lints and adds some allow annotations.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
#![warn(clippy::all, clippy::nursery, clippy::pedantic)]
|
||||
#![allow(clippy::missing_errors_doc, clippy::use_self)]
|
||||
#![allow(clippy::missing_errors_doc, clippy::use_self, clippy::doc_markdown)]
|
||||
|
||||
use std::path::Path;
|
||||
use std::path::PathBuf;
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#![allow(clippy::assigning_clones)]
|
||||
|
||||
use eframe::egui;
|
||||
use eframe::egui::color_picker::Alpha;
|
||||
use eframe::egui::Color32;
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
clippy::missing_errors_doc,
|
||||
clippy::redundant_pub_crate,
|
||||
clippy::significant_drop_tightening,
|
||||
clippy::significant_drop_in_scrutinee
|
||||
clippy::significant_drop_in_scrutinee,
|
||||
clippy::doc_markdown
|
||||
)]
|
||||
|
||||
use std::path::PathBuf;
|
||||
|
||||
@@ -333,7 +333,7 @@ impl StaticConfig {
|
||||
|
||||
let mut display = false;
|
||||
|
||||
for (_, aliases) in &map {
|
||||
for aliases in map.values() {
|
||||
for a in aliases {
|
||||
if raw.contains(a) {
|
||||
display = true;
|
||||
@@ -493,7 +493,11 @@ impl From<&WindowManager> for StaticConfig {
|
||||
}
|
||||
|
||||
impl StaticConfig {
|
||||
#[allow(clippy::cognitive_complexity, clippy::too_many_lines)]
|
||||
#[allow(
|
||||
clippy::cognitive_complexity,
|
||||
clippy::too_many_lines,
|
||||
clippy::assigning_clones
|
||||
)]
|
||||
fn apply_globals(&mut self) -> Result<()> {
|
||||
if let Some(monitor_index_preferences) = &self.monitor_index_preferences {
|
||||
let mut preferences = MONITOR_INDEX_PREFERENCES.lock();
|
||||
|
||||
@@ -276,8 +276,7 @@ impl WindowsApi {
|
||||
if monitors.elements().is_empty() {
|
||||
monitors.elements_mut().push_back(m);
|
||||
} else if let Some(preference) = index_preference {
|
||||
let current_len = monitors.elements().len();
|
||||
if *preference > current_len {
|
||||
while *preference > monitors.elements().len() {
|
||||
monitors.elements_mut().reserve(1);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#![warn(clippy::all, clippy::nursery, clippy::pedantic)]
|
||||
#![allow(clippy::missing_errors_doc)]
|
||||
#![allow(clippy::missing_errors_doc, clippy::doc_markdown)]
|
||||
|
||||
use chrono::Local;
|
||||
use std::fs::File;
|
||||
@@ -102,6 +102,7 @@ lazy_static! {
|
||||
};
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
trait AhkLibrary {
|
||||
fn generate_ahk_library() -> String;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user