mirror of
https://github.com/spacedriveapp/spacedrive.git
synced 2025-12-11 20:15:30 +01:00
Always enable tauri update + Misc Clippy warns fix (#1250)
Always enable tauri update - Fix some misc clippy warnings
This commit is contained in:
parent
9141333b15
commit
59ba9763fc
@ -9,7 +9,17 @@ repository = { workspace = true }
|
||||
edition = { workspace = true }
|
||||
|
||||
[dependencies]
|
||||
tauri = { version = "1.3.0", features = ["dialog-all", "linux-protocol-headers", "macos-private-api", "os-all", "path-all", "protocol-all", "shell-all", "window-all"] }
|
||||
tauri = { version = "1.3.0", features = [
|
||||
"dialog-all",
|
||||
"linux-protocol-headers",
|
||||
"macos-private-api",
|
||||
"os-all",
|
||||
"path-all",
|
||||
"protocol-all",
|
||||
"shell-all",
|
||||
"window-all",
|
||||
"updater",
|
||||
] }
|
||||
rspc = { workspace = true, features = ["tauri"] }
|
||||
httpz = { workspace = true, features = [
|
||||
"axum",
|
||||
@ -50,6 +60,5 @@ sd-desktop-windows = { path = "../crates/windows" }
|
||||
tauri-build = { version = "1.3.0", features = [] }
|
||||
|
||||
[features]
|
||||
default = ["custom-protocol", "updater"]
|
||||
updater = ["tauri/updater"]
|
||||
default = ["custom-protocol"]
|
||||
custom-protocol = ["tauri/custom-protocol"]
|
||||
|
||||
@ -144,7 +144,6 @@ async fn main() -> tauri::Result<()> {
|
||||
|
||||
let app = app
|
||||
.setup(|app| {
|
||||
#[cfg(feature = "updater")]
|
||||
tauri::updater::builder(app.handle()).should_install(|_current, _latest| true);
|
||||
|
||||
let app = app.handle();
|
||||
|
||||
@ -4,6 +4,7 @@ use serde::{Deserialize, Serialize};
|
||||
use specta::Type;
|
||||
use std::collections::BTreeMap;
|
||||
use std::collections::HashMap;
|
||||
use tracing::error;
|
||||
use uuid::Uuid;
|
||||
|
||||
use super::*;
|
||||
@ -31,9 +32,15 @@ impl LibraryPreferences {
|
||||
let prefs = PreferenceKVs::new(
|
||||
kvs.into_iter()
|
||||
.filter_map(|data| {
|
||||
let a = rmpv::decode::read_value(&mut data.value?.as_slice()).unwrap();
|
||||
|
||||
Some((PreferenceKey::new(data.key), PreferenceValue::from_value(a)))
|
||||
rmpv::decode::read_value(&mut data.value?.as_slice())
|
||||
.map_err(|e| error!("{e:#?}"))
|
||||
.ok()
|
||||
.map(|value| {
|
||||
(
|
||||
PreferenceKey::new(data.key),
|
||||
PreferenceValue::from_value(value),
|
||||
)
|
||||
})
|
||||
})
|
||||
.collect(),
|
||||
);
|
||||
|
||||
@ -7,7 +7,7 @@ use serde::{de::DeserializeOwned, Deserialize, Serialize};
|
||||
use specta::Type;
|
||||
|
||||
use std::collections::HashMap;
|
||||
|
||||
use tracing::error;
|
||||
use uuid::Uuid;
|
||||
|
||||
#[derive(Clone, Serialize, Deserialize, Type, Debug)]
|
||||
@ -35,7 +35,12 @@ where
|
||||
fn from_entries(entries: Entries) -> Self {
|
||||
entries
|
||||
.into_iter()
|
||||
.map(|(key, entry)| (Uuid::parse_str(&key).unwrap(), entry.expect_value()))
|
||||
.filter_map(|(key, entry)| {
|
||||
Uuid::parse_str(&key)
|
||||
.map_err(|e| error!("{e:#?}"))
|
||||
.ok()
|
||||
.map(|uuid| (uuid, entry.expect_value()))
|
||||
})
|
||||
.collect()
|
||||
}
|
||||
}
|
||||
|
||||
@ -125,7 +125,7 @@ pub async fn get_volumes() -> Vec<Volume> {
|
||||
|
||||
// Update mount point if not already present
|
||||
let mount_points = &mut volume.mount_points;
|
||||
if mount_point.iter().all(|p| p != &mount_point) {
|
||||
if mount_point.iter().all(|p| *p != mount_point) {
|
||||
mount_points.push(mount_point);
|
||||
let mount_points_to_check = mount_points.clone();
|
||||
mount_points.retain(|candidate| {
|
||||
|
||||
@ -697,7 +697,8 @@ impl KeyManager {
|
||||
self.ensure_not_queued(uuid)?;
|
||||
|
||||
if let Some(stored_key) = self.keystore.get(&uuid) {
|
||||
match stored_key.version {
|
||||
let version = &stored_key.version;
|
||||
match version {
|
||||
StoredKeyVersion::V1 => {
|
||||
self.mounting_queue.insert(uuid);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user