mirror of
https://github.com/humanlayer/humanlayer.git
synced 2025-08-20 19:01:22 +03:00
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:
@@ -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
|
||||
|
||||
@@ -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}"
|
||||
)));
|
||||
}
|
||||
|
||||
|
||||
@@ -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?"
|
||||
)));
|
||||
}
|
||||
|
||||
|
||||
@@ -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?;
|
||||
|
||||
|
||||
@@ -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!(
|
||||
|
||||
Reference in New Issue
Block a user