Skip to content

Commit

Permalink
Fix clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
shadow2469 authored and ktiays committed Oct 8, 2024
1 parent 6f44b72 commit f9f5501
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
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 @@ -129,8 +129,8 @@ pub async fn generate_project(prompt: &str, handler: ProjectHandler) -> Result<J

// The message sent by the report will automatically disappear after a short period of time.
// In order to keep the text displayed on the dialog box, report the title every time data is returned.
if current_task.is_some() {
progress.report(current_task.as_ref().unwrap().title());
if let Some(task) = &current_task {
progress.report(task.title());
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion crates/cursor-core/src/services/chat/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ enum SharedSessionState {
}

thread_local! {
static SHARED_SESSION: RefCell<SharedSessionState> = RefCell::new(SharedSessionState::Available(None));
static SHARED_SESSION: RefCell<SharedSessionState> = const { RefCell::new(SharedSessionState::Available(None)) };
}

#[wasm_bindgen(js_name = resetChat)]
Expand Down
10 changes: 6 additions & 4 deletions crates/node-bridge/src/http_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,20 @@ pub enum HttpMethod {
Delete,
}

impl ToString for HttpMethod {
fn to_string(&self) -> String {
match self {
impl std::fmt::Display for HttpMethod {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let description = match self {
HttpMethod::Get => "GET",
HttpMethod::Post => "POST",
HttpMethod::Put => "PUT",
HttpMethod::Delete => "DELETE",
}
.to_owned()
.to_owned();
write!(f, "{}", description)
}
}


/// An HTTP request.
///
/// When performing the request, it uses [`request`] from Node.js as
Expand Down

0 comments on commit f9f5501

Please sign in to comment.