chore: fix formatting and clippy lints
This commit is contained in:
1 parent
8952bd5399
commit
9d9e959744
35 files changed
+1091
-582
No files matched your search
+4
-6
@@ -86,11 +86,10 @@ impl ClipboardCacheState {
|
||||
}
|
||||
|
||||
pub fn push_text(&mut self, text: CachedClipboardText) {
|
||||
if let Some(ref prev) = self.last_text {
|
||||
if prev.text == text.text {
|
||||
if let Some(ref prev) = self.last_text
|
||||
&& prev.text == text.text {
|
||||
return;
|
||||
}
|
||||
}
|
||||
self.last_text = Some(text.clone());
|
||||
self.history.push_front(ClipboardHistoryItem::Text(text));
|
||||
if self.history.len() > 20 {
|
||||
@@ -142,11 +141,10 @@ impl MemoryState {
|
||||
pub fn new(base_dir_str: &str) -> Self {
|
||||
let is_in_memory = base_dir_str == ":memory:";
|
||||
let base = std::path::PathBuf::from(base_dir_str);
|
||||
if !is_in_memory {
|
||||
if let Err(e) = std::fs::create_dir_all(&base) {
|
||||
if !is_in_memory
|
||||
&& let Err(e) = std::fs::create_dir_all(&base) {
|
||||
tracing::error!("Failed to create store directory at {:?}: {}", base, e);
|
||||
}
|
||||
}
|
||||
|
||||
let db = crate::db::init_redb(&base);
|
||||
|
||||
|
||||
Reference in new issue
Block a user