Allison/eng 1725 rust 1880 breaks our tauri build (#342)

* Fix Rust 1.88.0 compatibility by updating string formatting

Update format strings to use inline variables syntax throughout the
daemon client code. This addresses build issues with Rust 1.88.0
which may have stricter linting rules for string formatting.

* Add rust-clippy-fix command to Makefile

Add a convenience command to automatically fix clippy warnings.
This helps streamline the process of addressing linting issues
in the Rust codebase.
This commit is contained in:
Allison Durham
2025-07-23 09:16:15 -07:00
committed by GitHub
parent a85df38235
commit 3f19808adb
5 changed files with 10 additions and 10 deletions

View File

@@ -33,6 +33,9 @@ rust-check: ## Run Rust compilation check
rust-clippy: ## Run Rust linter (clippy)
cd src-tauri && cargo clippy -- -D warnings
rust-clippy-fix: ## Run clippy fix
cd src-tauri && cargo clippy --fix --allow-dirty
# Placeholder for future test command
check-quiet: ## Run all quality checks with quiet output

View File

@@ -108,7 +108,7 @@ impl DaemonClient {
if let Some(result) = response.result {
serde_json::from_value(result)
.map_err(|e| Error::InvalidResponse(format!("Failed to parse result: {}", e)))
.map_err(|e| Error::InvalidResponse(format!("Failed to parse result: {e}")))
} else {
Err(Error::InvalidResponse("No result in response".to_string()))
}
@@ -256,8 +256,7 @@ impl DaemonClientTrait for DaemonClient {
if !response.success {
return Err(Error::Session(format!(
"Failed to interrupt session {}",
session_id
"Failed to interrupt session {session_id}"
)));
}
@@ -305,8 +304,7 @@ impl DaemonClientTrait for DaemonClient {
if !response.success {
return Err(Error::Session(format!(
"Failed to update title for session {}",
session_id
"Failed to update title for session {session_id}"
)));
}

View File

@@ -61,7 +61,7 @@ impl Connection {
let mut stream = self.stream.lock().await;
// Send the message with newline
let message_with_newline = format!("{}\n", message);
let message_with_newline = format!("{message}\n");
stream
.write_all(message_with_newline.as_bytes())
.await
@@ -108,8 +108,7 @@ impl Connection {
// Check if socket exists
if !path.exists() {
return Err(Error::Connection(format!(
"Socket not found at {:?}. Is the daemon running?",
path
"Socket not found at {path:?}. Is the daemon running?"
)));
}

View File

@@ -91,7 +91,7 @@ async fn handle_subscription(
) -> Result<()> {
// Send the subscription request
stream
.write_all(format!("{}\n", request_str).as_bytes())
.write_all(format!("{request_str}\n").as_bytes())
.await?;
stream.flush().await?;

View File

@@ -268,7 +268,7 @@ async fn unsubscribe_from_events(
// Parse the subscription ID
let id = subscription_id
.parse::<u64>()
.map_err(|e| format!("Invalid subscription ID: {}", e))?;
.map_err(|e| format!("Invalid subscription ID: {e}"))?;
client.unsubscribe(id).await.map_err(|e| e.to_string())?;
tracing::info!(