Skip to content

Commit eade9b4

Browse files
committed
style: format Rust code with cargo fmt
1 parent b97d493 commit eade9b4

4 files changed

Lines changed: 13 additions & 12 deletions

File tree

src-tauri/src/db/mod.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,9 @@ impl Database {
4242
fn get_setting_string(&self, key: &str, default: &str) -> Result<String, AppError> {
4343
let conn = self.lock_conn()?;
4444
Ok(conn
45-
.query_row(
46-
"SELECT value FROM settings WHERE key = ?1",
47-
[key],
48-
|row| row.get(0),
49-
)
45+
.query_row("SELECT value FROM settings WHERE key = ?1", [key], |row| {
46+
row.get(0)
47+
})
5048
.unwrap_or_else(|_| default.to_string()))
5149
}
5250

@@ -480,8 +478,7 @@ impl Database {
480478
/// Gets all configured servers with credentials from keychain.
481479
fn get_servers_with_credentials(&self) -> Result<Vec<ServerConfig>, AppError> {
482480
let conn = self.lock_conn()?;
483-
let mut stmt =
484-
conn.prepare("SELECT url, username, password, is_default FROM servers")?;
481+
let mut stmt = conn.prepare("SELECT url, username, password, is_default FROM servers")?;
485482
let servers_from_db: Vec<(String, Option<String>, Option<String>, bool)> = stmt
486483
.query_map([], |row| {
487484
Ok((

src-tauri/src/models/settings.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,14 @@ impl ServerConfig {
2323
pub fn validate(&self) -> Result<(), AppError> {
2424
// Check URL is not empty
2525
if self.url.trim().is_empty() {
26-
return Err(AppError::InvalidUrl("Server URL cannot be empty".to_string()));
26+
return Err(AppError::InvalidUrl(
27+
"Server URL cannot be empty".to_string(),
28+
));
2729
}
2830

2931
// Parse and validate URL
30-
let parsed = Url::parse(&self.url)
31-
.map_err(|e| AppError::InvalidUrl(format!("Invalid URL: {e}")))?;
32+
let parsed =
33+
Url::parse(&self.url).map_err(|e| AppError::InvalidUrl(format!("Invalid URL: {e}")))?;
3234

3335
// Check scheme is http or https
3436
if !["http", "https"].contains(&parsed.scheme()) {

src-tauri/src/services/ntfy_client.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,4 +184,3 @@ impl NtfyClient {
184184
Ok(messages)
185185
}
186186
}
187-

src-tauri/src/services/sync_service.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,10 @@ impl SyncService {
134134

135135
for sub in subscriptions {
136136
// Find server credentials for this subscription
137-
let server = settings.servers.iter().find(|s| s.url_matches(&sub.server_url));
137+
let server = settings
138+
.servers
139+
.iter()
140+
.find(|s| s.url_matches(&sub.server_url));
138141
let (username, password) = match server {
139142
Some(s) => (s.username.as_deref(), s.password.as_deref()),
140143
None => (None, None),

0 commit comments

Comments
 (0)