Skip to content

YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context

chore: cargo fmt on tray, store, commands

Louis Beaumont50953b8427d3
diff --git a/apps/screenpipe-app-tauri/src-tauri/src/commands.rs b/apps/screenpipe-app-tauri/src-tauri/src/commands.rs
index b4f77630d..173df479a 100644
--- a/apps/screenpipe-app-tauri/src-tauri/src/commands.rs
+++ b/apps/screenpipe-app-tauri/src-tauri/src/commands.rs
@@ -122,7 +122,10 @@ pub fn get_enterprise_license_key() -> Option<String> {
// Fallback: ~/.screenpipe/enterprise.json (manually entered by employee)
let user_path = screenpipe_core::paths::default_screenpipe_data_dir().join("enterprise.json");
if user_path.exists() {
- info!("enterprise: checking user config at {}", user_path.display());
+ info!(
+ "enterprise: checking user config at {}",
+ user_path.display()
+ );
return read_enterprise_key_from_path(&user_path);
}
@@ -150,7 +153,10 @@ fn read_enterprise_key_from_exe_dir() -> Option<String> {
};
if !config_path.exists() {
- info!("enterprise: no enterprise.json at {}", config_path.display());
+ info!(
+ "enterprise: no enterprise.json at {}",
+ config_path.display()
+ );
return None;
}
@@ -180,7 +186,10 @@ fn read_enterprise_key_from_path(path: &std::path::Path) -> Option<String> {
.map(|s| s.to_string());
match &key {
- Some(k) => info!("enterprise: license key loaded ({}...)", &k[..k.len().min(8)]),
+ Some(k) => info!(
+ "enterprise: license key loaded ({}...)",
+ &k[..k.len().min(8)]
+ ),
None => warn!("enterprise: enterprise.json missing 'license_key' field"),
}
diff --git a/apps/screenpipe-app-tauri/src-tauri/src/store.rs b/apps/screenpipe-app-tauri/src-tauri/src/store.rs
index ab9c339b8..dd90f9089 100644
--- a/apps/screenpipe-app-tauri/src-tauri/src/store.rs
+++ b/apps/screenpipe-app-tauri/src-tauri/src/store.rs
@@ -728,10 +728,7 @@ pub fn init_store(app: &AppHandle) -> Result<SettingsStore, String> {
let (mut store, mut should_save) = match SettingsStore::get(app) {
Ok(Some(store)) => {
is_new_store = false;
- (
- store,
- should_persist_restart_notification_migration,
- )
+ (store, should_persist_restart_notification_migration)
}
Ok(None) => {
is_new_store = true;
@@ -758,13 +755,13 @@ pub fn init_store(app: &AppHandle) -> Result<SettingsStore, String> {
// (e.g. tier boundaries changed in an update).
{
let detected = screenpipe_config::detect_tier();
- let stored_tier = store.recording.device_tier.as_deref()
+ let stored_tier = store
+ .recording
+ .device_tier
+ .as_deref()
.and_then(screenpipe_config::DeviceTier::from_str_loose);
if stored_tier != Some(detected) {
- tracing::info!(
- "hardware tier changed: {:?} -> {:?}",
- stored_tier, detected
- );
+ tracing::info!("hardware tier changed: {:?} -> {:?}", stored_tier, detected);
if is_new_store || store.recording.device_tier.is_none() {
screenpipe_config::apply_tier_defaults(&mut store.recording, detected);
}
@@ -774,7 +771,10 @@ pub fn init_store(app: &AppHandle) -> Result<SettingsStore, String> {
// Unconditional safety guard: prevent parakeet/parakeet-mlx on platforms
// where it will crash (Low tier = OOM, macOS < 26 = MLX segfault).
- if screenpipe_config::is_engine_unsafe(&store.recording.audio_transcription_engine, detected) {
+ if screenpipe_config::is_engine_unsafe(
+ &store.recording.audio_transcription_engine,
+ detected,
+ ) {
let safe = screenpipe_config::best_engine_for_platform(detected);
tracing::warn!(
"engine {} is unsafe on this platform (tier={:?}, macOS={:?}) — switching to {}",
diff --git a/apps/screenpipe-app-tauri/src-tauri/src/tray.rs b/apps/screenpipe-app-tauri/src-tauri/src/tray.rs
index d38fc12ab..7644665fe 100644
--- a/apps/screenpipe-app-tauri/src-tauri/src/tray.rs
+++ b/apps/screenpipe-app-tauri/src-tauri/src/tray.rs
@@ -43,12 +43,18 @@ static OPTIMISTIC_STATUS: Lazy<Mutex<Option<(RecordingStatus, std::time::Instant
fn set_optimistic_status(status: RecordingStatus) {
let mut opt = OPTIMISTIC_STATUS.lock().unwrap_or_else(|e| e.into_inner());
- *opt = Some((status, std::time::Instant::now() + std::time::Duration::from_secs(15)));
+ *opt = Some((
+ status,
+ std::time::Instant::now() + std::time::Duration::from_secs(15),
+ ));
}
/// Immediately rebuild the tray menu (called from main thread after optimistic status set).
fn force_tray_rebuild(app: &AppHandle) -> Result<()> {
- let update_item = UPDATE_MENU_ITEM.lock().unwrap_or_else(|e| e.into_inner()).clone();
+ let update_item = UPDATE_MENU_ITEM
+ .lock()
+ .unwrap_or_else(|e| e.into_inner())
+ .clone();
let state = {
let mut last = LAST_MENU_STATE.lock().unwrap_or_else(|e| e.into_inner());
// Reset to force rebuild
@@ -391,8 +397,7 @@ fn create_dynamic_menu(
RecordingStatus::Stopped => "○ Stopped",
RecordingStatus::Error => "○ Error",
};
- menu_builder = menu_builder
- .item(&PredefinedMenuItem::separator(app)?);
+ menu_builder = menu_builder.item(&PredefinedMenuItem::separator(app)?);
if effective_status == RecordingStatus::Recording
|| effective_status == RecordingStatus::Starting
@@ -405,10 +410,10 @@ fn create_dynamic_menu(
}
menu_builder = menu_builder.item(
- &MenuItemBuilder::with_id("recording_status", status_text)
- .enabled(false)
- .build(app)?,
- );
+ &MenuItemBuilder::with_id("recording_status", status_text)
+ .enabled(false)
+ .build(app)?,
+ );
if effective_status == RecordingStatus::Recording
|| effective_status == RecordingStatus::Starting
@@ -531,10 +536,10 @@ fn create_dynamic_menu(
);
}
menu_builder = menu_builder.item(
- &MenuItemBuilder::with_id("quit", "Quit screenpipe")
- .accelerator("CmdOrCtrl+Q")
- .build(app)?,
- );
+ &MenuItemBuilder::with_id("quit", "Quit screenpipe")
+ .accelerator("CmdOrCtrl+Q")
+ .build(app)?,
+ );
menu_builder.build().map_err(Into::into)
}