Skip to content

Commit

Permalink
style: simplify string formatting for readability
Browse files Browse the repository at this point in the history
  • Loading branch information
hamirmahal authored and unixzii committed Oct 6, 2024
1 parent bfc3ae4 commit 6f44b72
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions crates/cursor-core/src/auth/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ async fn polling(
}
let Ok(mut response) = make_request(
API2_HOST,
&format!("/auth/poll?uuid={}&verifier={}", uuid, verifier),
&format!("/auth/poll?uuid={uuid}&verifier={verifier}"),
HttpMethod::Get,
)
.send()
Expand Down Expand Up @@ -220,7 +220,7 @@ pub async fn refresh() -> Result<(), JsValue> {
.text()
.await;
#[cfg(debug_assertions)]
console::log_str(&format!("refresh token response: {}", response));
console::log_str(&format!("refresh token response: {response}"));
let access_token = serde_json::from_str::<RefreshResponse>(&response)
.map_err(JsError::from)?
.access_token;
Expand Down
4 changes: 2 additions & 2 deletions crates/cursor-core/src/project/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,15 @@ pub async fn generate_project(prompt: &str, handler: ProjectHandler) -> Result<J
current_task = Some(Task::Step(task.to_owned()));
} else if data.starts_with(CREATE_MESSAGE) {
let task = data[CREATE_MESSAGE.len() + 1..].trim();
current_task = Some(Task::Create(format!("Creating {}", task)));
current_task = Some(Task::Create(format!("Creating {task}")));

// The title of the "create" message is a file path,
// which requires creating a file based on the path.
handler.create_file_recursive(task).await;
} else if data.starts_with(APPEND_MESSAGE) {
let task = data[APPEND_MESSAGE.len() + 1..].trim();
current_task =
Some(Task::Append(format!("Appending contents to {}", task)));
Some(Task::Append(format!("Appending contents to {task}")));

file_writer = handler.make_file_writer(task);
} else if data.starts_with(END_MESSAGE) {
Expand Down
2 changes: 1 addition & 1 deletion crates/cursor-core/src/services/chat/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ impl Session {
serde_json::from_str::<MessageContent>(&data)
{
#[cfg(debug_assertions)]
console::log_str(&format!("wrote: {}", text));
console::log_str(&format!("wrote: {text}"));
result_stream.write(&text);
message.push_str(&data);
}
Expand Down
2 changes: 1 addition & 1 deletion crates/cursor-core/src/services/generate/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ impl CodeGenerateService {
serde_json::from_str::<MessageContent>(&data)
{
#[cfg(debug_assertions)]
console::log_str(&format!("wrote: {}", text));
console::log_str(&format!("wrote: {text}"));
result_stream.write(&text);
}
}
Expand Down

0 comments on commit 6f44b72

Please sign in to comment.