From 3692029a80414946a678086dad753902f1575d64 Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Mon, 10 Aug 2026 01:29:52 +0300 Subject: [PATCH] Bump rustc to 1.97 (#62395) Release Notes: - N/A --- Dockerfile-collab | 2 +- crates/agent/src/tools/list_directory_tool.rs | 10 +++++----- crates/agent/src/tools/read_file_tool.rs | 12 ++++++------ crates/agent_ui/src/language_model_selector.rs | 6 +----- crates/call/src/call_impl/room.rs | 4 ++-- crates/client/src/client.rs | 4 ++-- crates/collab/src/db/queries/channels.rs | 2 +- crates/collab/src/lib.rs | 16 +++++++--------- crates/collab/src/services/user_service.rs | 13 +++++-------- .../tests/integration/integration_tests.rs | 2 +- .../random_project_collaboration_tests.rs | 2 +- crates/collab_ui/src/collab_panel.rs | 8 ++++---- .../collab_ui/src/collab_panel/channel_modal.rs | 5 ++--- crates/context_server/src/client.rs | 4 ++-- crates/context_server/src/listener.rs | 4 ++-- crates/dap/src/adapters.rs | 2 +- crates/dap/src/transport.rs | 4 ++-- crates/debugger_ui/src/new_process_modal.rs | 2 +- crates/debugger_ui/src/session/running.rs | 4 ++-- .../src/session/running/variable_list.rs | 2 +- .../dev_container/src/devcontainer_manifest.rs | 4 ++-- crates/docs_preprocessor/src/main.rs | 2 +- crates/edit_prediction_cli/src/example.rs | 2 +- crates/edit_prediction_cli/src/reorder_patch.rs | 6 +++--- crates/eval_cli/Dockerfile | 4 ++-- crates/fs/src/fs.rs | 2 +- .../src/providers/chromium.rs | 2 +- crates/git_ui/src/git_panel.rs | 4 +++- crates/google_ai/src/google_ai.rs | 2 +- crates/gpui/examples/hello_world.rs | 2 +- crates/gpui/examples/mouse_pressure.rs | 4 ++-- .../gpui/examples/move_entity_between_windows.rs | 2 +- crates/gpui_macos/build.rs | 2 +- crates/gpui_util/src/lib.rs | 2 +- crates/language/src/text_diff.rs | 2 +- crates/languages/src/rust.rs | 2 +- crates/livekit_client/examples/test_app.rs | 4 ++-- crates/lsp/src/lsp.rs | 16 ++++++++-------- crates/outline_panel/src/outline_panel.rs | 2 +- crates/project/src/debugger/session.rs | 2 +- crates/project/src/worktree_store.rs | 2 +- .../project/tests/integration/project_tests.rs | 4 ++-- crates/project_benchmarks/src/main.rs | 2 +- crates/project_panel/src/tests/undo.rs | 2 +- crates/remote/src/remote_client.rs | 2 +- crates/remote/src/transport/ssh.rs | 4 ++-- crates/remote/src/transport/wsl.rs | 2 +- crates/remote_server/src/server.rs | 2 +- crates/repl/src/notebook/cell.rs | 3 +-- crates/settings/src/keymap_file.rs | 10 +++++----- crates/sidebar/src/sidebar_tests.rs | 7 +------ crates/sqlez_macros/src/sqlez_macros.rs | 2 +- crates/sum_tree/src/cursor.rs | 2 +- crates/terminal/src/alacritty/hyperlinks.rs | 2 +- crates/text/src/patch.rs | 6 +++--- .../toolchain_selector/src/active_toolchain.rs | 2 +- crates/vim/src/command.rs | 2 +- crates/workspace/src/pane.rs | 2 +- crates/worktree/src/worktree.rs | 10 ++-------- .../worktree/tests/integration/worktree_tests.rs | 2 +- crates/zeta_prompt/src/udiff.rs | 2 +- extensions/proto/src/language_servers/buf.rs | 5 +---- extensions/proto/src/language_servers/protols.rs | 5 +---- flake.lock | 6 +++--- rust-toolchain.toml | 2 +- tooling/xtask/src/tasks/workflows/vars.rs | 2 +- 66 files changed, 121 insertions(+), 147 deletions(-) diff --git a/Dockerfile-collab b/Dockerfile-collab index fbbcb0df04..5250f52102 100644 --- a/Dockerfile-collab +++ b/Dockerfile-collab @@ -1,6 +1,6 @@ # syntax = docker/dockerfile:1.2 -FROM rust:1.94-bookworm as builder +FROM rust:1.97-bookworm as builder WORKDIR app COPY . . diff --git a/crates/agent/src/tools/list_directory_tool.rs b/crates/agent/src/tools/list_directory_tool.rs index 5fe605176a..fa61ac4d1b 100644 --- a/crates/agent/src/tools/list_directory_tool.rs +++ b/crates/agent/src/tools/list_directory_tool.rs @@ -270,21 +270,21 @@ impl AgentTool for ListDirectoryTool { let worktree = project .worktree_for_id(project_path.worktree_id, cx) .with_context(|| { - format!("{} is not in a known worktree", &input.path) + format!("{} is not in a known worktree", input.path) })?; let global_settings = WorktreeSettings::get_global(cx); if global_settings.is_path_excluded(&project_path.path) { anyhow::bail!( "Cannot list directory because its path matches the user's global `file_scan_exclusions` setting: {}", - &input.path + input.path ); } if global_settings.is_path_private(&project_path.path) { anyhow::bail!( "Cannot list directory because its path matches the user's global `private_files` setting: {}", - &input.path + input.path ); } @@ -292,14 +292,14 @@ impl AgentTool for ListDirectoryTool { if worktree_settings.is_path_excluded(&project_path.path) { anyhow::bail!( "Cannot list directory because its path matches the user's worktree `file_scan_exclusions` setting: {}", - &input.path + input.path ); } if worktree_settings.is_path_private(&project_path.path) { anyhow::bail!( "Cannot list directory because its path matches the user's worktree `private_paths` setting: {}", - &input.path + input.path ); } diff --git a/crates/agent/src/tools/read_file_tool.rs b/crates/agent/src/tools/read_file_tool.rs index 0c5996a6f6..df48508fbd 100644 --- a/crates/agent/src/tools/read_file_tool.rs +++ b/crates/agent/src/tools/read_file_tool.rs @@ -295,7 +295,7 @@ impl AgentTool for ReadFileTool { project.absolute_path(&project_path, cx) }) .ok_or_else(|| { - anyhow!("Failed to convert {} to absolute path", &input.path) + anyhow!("Failed to convert {} to absolute path", input.path) }).map_err(tool_content_err)?; // Check settings exclusions synchronously @@ -304,14 +304,14 @@ impl AgentTool for ReadFileTool { if global_settings.is_path_excluded(&project_path.path) { anyhow::bail!( "Cannot read file because its path matches the global `file_scan_exclusions` setting: {}", - &input.path + input.path ); } if global_settings.is_path_private(&project_path.path) { anyhow::bail!( "Cannot read file because its path matches the global `private_files` setting: {}", - &input.path + input.path ); } @@ -319,14 +319,14 @@ impl AgentTool for ReadFileTool { if worktree_settings.is_path_excluded(&project_path.path) { anyhow::bail!( "Cannot read file because its path matches the worktree `file_scan_exclusions` setting: {}", - &input.path + input.path ); } if worktree_settings.is_path_private(&project_path.path) { anyhow::bail!( "Cannot read file because its path matches the worktree `private_files` setting: {}", - &input.path + input.path ); } @@ -336,7 +336,7 @@ impl AgentTool for ReadFileTool { if fs.is_dir(&abs_path).await { return Err(tool_content_err(format!( "{} is a directory, not a file. Use the list_directory tool to explore directory contents.", - &input.path + input.path ))); } diff --git a/crates/agent_ui/src/language_model_selector.rs b/crates/agent_ui/src/language_model_selector.rs index 7f9ff087b3..2c19e11157 100644 --- a/crates/agent_ui/src/language_model_selector.rs +++ b/crates/agent_ui/src/language_model_selector.rs @@ -378,11 +378,7 @@ impl ModelMatcher { .map(|(index, model)| { StringMatchCandidate::new( index, - &format!( - "{}/{}", - &model.model.provider_name().0, - &model.model.name().0 - ), + &format!("{}/{}", model.model.provider_name().0, model.model.name().0), ) }) .collect::>() diff --git a/crates/call/src/call_impl/room.rs b/crates/call/src/call_impl/room.rs index 108c5a4630..0c9667bd0e 100644 --- a/crates/call/src/call_impl/room.rs +++ b/crates/call/src/call_impl/room.rs @@ -713,7 +713,7 @@ impl Room { log::trace!( "client {:?}. room update: {:?}", self.client.user_id(), - &room + room ); self.pending_room_update = Some(self.start_room_connection(room, cx)); @@ -1001,7 +1001,7 @@ impl Room { log::trace!( "client {:?}. livekit event: {:?}", self.client.user_id(), - &event + event ); match event { diff --git a/crates/client/src/client.rs b/crates/client/src/client.rs index 7273da7222..c12ea19e39 100644 --- a/crates/client/src/client.rs +++ b/crates/client/src/client.rs @@ -67,7 +67,7 @@ static ZED_RPC_URL: LazyLock> = LazyLock::new(|| std::env::var("Z pub static IMPERSONATE_LOGIN: LazyLock> = LazyLock::new(|| { std::env::var("ZED_IMPERSONATE") .ok() - .and_then(|s| if s.is_empty() { None } else { Some(s) }) + .filter(|s| !s.is_empty()) }); pub static USE_WEB_LOGIN: LazyLock = LazyLock::new(|| std::env::var("ZED_WEB_LOGIN").is_ok()); @@ -75,7 +75,7 @@ pub static USE_WEB_LOGIN: LazyLock = LazyLock::new(|| std::env::var("ZED_W pub static ADMIN_API_TOKEN: LazyLock> = LazyLock::new(|| { std::env::var("ZED_ADMIN_API_TOKEN") .ok() - .and_then(|s| if s.is_empty() { None } else { Some(s) }) + .filter(|s| !s.is_empty()) }); pub static ZED_APP_PATH: LazyLock> = diff --git a/crates/collab/src/db/queries/channels.rs b/crates/collab/src/db/queries/channels.rs index 03f561d729..d54b4f6df1 100644 --- a/crates/collab/src/db/queries/channels.rs +++ b/crates/collab/src/db/queries/channels.rs @@ -939,7 +939,7 @@ impl Database { let root_id = channel.root_id(); let new_parent_path = new_parent.path(); let old_path = format!("{}{}/", channel.parent_path, channel.id); - let new_path = format!("{}{}/", &new_parent_path, channel.id); + let new_path = format!("{}{}/", new_parent_path, channel.id); let new_order = max_order(&new_parent_path, &tx).await? + 1; let mut model = channel.into_active_model(); diff --git a/crates/collab/src/lib.rs b/crates/collab/src/lib.rs index ff415a71dd..ac8bbd77b8 100644 --- a/crates/collab/src/lib.rs +++ b/crates/collab/src/lib.rs @@ -72,24 +72,22 @@ impl IntoResponse for Error { fn into_response(self) -> axum::response::Response { match self { Error::Http(code, message, headers) => { - log::error!("HTTP error {}: {}", code, &message); + log::error!("HTTP error {code}: {message}"); (code, headers, message).into_response() } Error::Database(error) => { log::error!( - "HTTP error {}: {:?}", - StatusCode::INTERNAL_SERVER_ERROR, - &error + "HTTP error {}: {error:?}", + StatusCode::INTERNAL_SERVER_ERROR ); - (StatusCode::INTERNAL_SERVER_ERROR, format!("{}", &error)).into_response() + (StatusCode::INTERNAL_SERVER_ERROR, format!("{error}")).into_response() } Error::Internal(error) => { log::error!( - "HTTP error {}: {:?}", - StatusCode::INTERNAL_SERVER_ERROR, - &error + "HTTP error {}: {error:?}", + StatusCode::INTERNAL_SERVER_ERROR ); - (StatusCode::INTERNAL_SERVER_ERROR, format!("{}", &error)).into_response() + (StatusCode::INTERNAL_SERVER_ERROR, format!("{error}")).into_response() } } } diff --git a/crates/collab/src/services/user_service.rs b/crates/collab/src/services/user_service.rs index 61541aa5a1..8dfa930dcd 100644 --- a/crates/collab/src/services/user_service.rs +++ b/crates/collab/src/services/user_service.rs @@ -68,10 +68,7 @@ impl CloudUserService { ) -> Result { let request = request .header("Content-Type", "application/json") - .header( - "Authorization", - format!("Bearer {}", &self.internal_api_key), - ) + .header("Authorization", format!("Bearer {}", self.internal_api_key)) .build() .context("failed to build request")?; @@ -104,7 +101,7 @@ impl UserService for CloudUserService { self.http_client .post(format!( "{}/internal/users/look_up_by_legacy_id", - &self.zed_cloud_url + self.zed_cloud_url )) .json(&LookUpUsersByLegacyIdBody { legacy_user_ids: ids.into_iter().map(|id| id.0).collect(), @@ -121,7 +118,7 @@ impl UserService for CloudUserService { self.http_client .post(format!( "{}/internal/users/look_up_by_github_login", - &self.zed_cloud_url + self.zed_cloud_url )) .json(&LookUpUserByGithubLoginBody { github_login: github_login.to_string(), @@ -138,7 +135,7 @@ impl UserService for CloudUserService { self.http_client .post(format!( "{}/internal/users/fuzzy_search", - &self.zed_cloud_url + self.zed_cloud_url )) .json(&FuzzySearchUsersBody { query: query.to_string(), @@ -161,7 +158,7 @@ impl UserService for CloudUserService { self.http_client .post(format!( "{}/internal/channel_members/fuzzy_search", - &self.zed_cloud_url + self.zed_cloud_url )) .json(&FuzzySearchChannelMembersBody { channel_id: channel.root_id().0, diff --git a/crates/collab/tests/integration/integration_tests.rs b/crates/collab/tests/integration/integration_tests.rs index e6c377e3d4..cc092f3e23 100644 --- a/crates/collab/tests/integration/integration_tests.rs +++ b/crates/collab/tests/integration/integration_tests.rs @@ -5736,7 +5736,7 @@ async fn test_lsp_hover( let new_server = language_servers[i].next().await.unwrap_or_else(|| { panic!( "Failed to get language server #{i} with name {}", - &language_server_names[i] + language_server_names[i] ) }); let new_server_name = new_server.server.name(); diff --git a/crates/collab/tests/integration/random_project_collaboration_tests.rs b/crates/collab/tests/integration/random_project_collaboration_tests.rs index d8e66e7a5e..92fef2f79e 100644 --- a/crates/collab/tests/integration/random_project_collaboration_tests.rs +++ b/crates/collab/tests/integration/random_project_collaboration_tests.rs @@ -1116,7 +1116,7 @@ impl RandomizedTest for ProjectCollaborationTest { .map(|_| files.choose(&mut rng).unwrap().clone()) .collect::>(); async move { - log::info!("LSP: Returning definitions in files {:?}", &files); + log::info!("LSP: Returning definitions in files {files:?}"); Ok(Some(lsp::GotoDefinitionResponse::Array( files .into_iter() diff --git a/crates/collab_ui/src/collab_panel.rs b/crates/collab_ui/src/collab_panel.rs index 14d6062717..655c35abb4 100644 --- a/crates/collab_ui/src/collab_panel.rs +++ b/crates/collab_ui/src/collab_panel.rs @@ -3219,15 +3219,15 @@ impl CollabPanel { .when(open_context_menu.is_none(), |this| { this.tooltip(move |_, cx| { let text = if !online { - format!(" {} is Offline", &username) + format!(" {username} is Offline") } else if busy { - format!(" {} is on a Call", &username) + format!(" {username} is on a Call") } else { let room = ActiveCall::global(cx).read(cx).room(); if room.is_some() { - format!("Invite {} to Join Call", &username) + format!("Invite {username} to Join Call") } else { - format!("Call {}", &username) + format!("Call {username}") } }; Tooltip::simple(text, cx) diff --git a/crates/collab_ui/src/collab_panel/channel_modal.rs b/crates/collab_ui/src/collab_panel/channel_modal.rs index 43f5e5656e..163e463e59 100644 --- a/crates/collab_ui/src/collab_panel/channel_modal.rs +++ b/crates/collab_ui/src/collab_panel/channel_modal.rs @@ -178,7 +178,7 @@ impl Render for ChannelModal { .on_click(cx.listener(Self::set_channel_visibility)), ) .children( - Some( + (visibility == ChannelVisibility::Public).then_some( Button::new("copy-link", "Copy Link") .label_size(LabelSize::Small) .on_click(cx.listener(move |this, _, _, cx| { @@ -192,8 +192,7 @@ impl Render for ChannelModal { cx.write_to_clipboard(item); } })), - ) - .filter(|_| visibility == ChannelVisibility::Public), + ), ), ) .child( diff --git a/crates/context_server/src/client.rs b/crates/context_server/src/client.rs index 3761f19ec4..4e41ed98e2 100644 --- a/crates/context_server/src/client.rs +++ b/crates/context_server/src/client.rs @@ -177,7 +177,7 @@ impl Client { log::debug!( "starting context server (executable={:?}, args={:?})", binary.executable, - &binary.args + binary.args ); let server_name = binary @@ -279,7 +279,7 @@ impl Client { let mut receiver = transport.receive(); while let Some(message) = receiver.next().await { - log::trace!("recv: {}", &message); + log::trace!("recv: {message}"); if let Ok(request) = serde_json::from_str::(&message) { let mut request_handlers = request_handlers.lock(); if let Some(handler) = request_handlers.get_mut(request.method) { diff --git a/crates/context_server/src/listener.rs b/crates/context_server/src/listener.rs index a9be4c07a2..0a3f4bcc31 100644 --- a/crates/context_server/src/listener.rs +++ b/crates/context_server/src/listener.rs @@ -363,7 +363,7 @@ impl McpServer { select_biased! { message = outgoing_rx.next().fuse() => { if let Some(message) = message { - log::trace!("send: {}", &message); + log::trace!("send: {message}"); outgoing_bytes.write_all(message.as_bytes()).await?; outgoing_bytes.write_all(&[b'\n']).await?; } else { @@ -374,7 +374,7 @@ impl McpServer { if bytes_read? == 0 { break } - log::trace!("recv: {}", &incoming_line); + log::trace!("recv: {incoming_line}"); match serde_json::from_str(&incoming_line) { Ok(message) => { incoming_tx.unbounded_send(message).log_err(); diff --git a/crates/dap/src/adapters.rs b/crates/dap/src/adapters.rs index 0f4bb937c1..70cf30878a 100644 --- a/crates/dap/src/adapters.rs +++ b/crates/dap/src/adapters.rs @@ -294,7 +294,7 @@ pub async fn download_adapter_from_github( log::debug!( "Downloading adapter {} from {}", adapter_name, - &github_version.url, + github_version.url, ); delegate.output_to_console(format!("Downloading from {}...", github_version.url)); diff --git a/crates/dap/src/transport.rs b/crates/dap/src/transport.rs index 726c626892..46831951d0 100644 --- a/crates/dap/src/transport.rs +++ b/crates/dap/src/transport.rs @@ -247,7 +247,7 @@ impl TransportDelegate { let mut line = String::new(); loop { - line.truncate(0); + line.clear(); match reader.read_line(&mut line).await { Ok(0) => break, @@ -398,7 +398,7 @@ impl TransportDelegate { { let mut content_length = None; loop { - buffer.truncate(0); + buffer.clear(); match reader.read_line(buffer).await { Ok(0) => return ConnectionResult::ConnectionReset, Ok(_) => {} diff --git a/crates/debugger_ui/src/new_process_modal.rs b/crates/debugger_ui/src/new_process_modal.rs index bb72a8dd17..2254f2bb43 100644 --- a/crates/debugger_ui/src/new_process_modal.rs +++ b/crates/debugger_ui/src/new_process_modal.rs @@ -1618,7 +1618,7 @@ pub(crate) fn resolve_path(path: &mut String) { *path = format!( "$ZED_WORKTREE_ROOT{}{}", std::path::MAIN_SEPARATOR, - &strip_path + strip_path ); }; } diff --git a/crates/debugger_ui/src/session/running.rs b/crates/debugger_ui/src/session/running.rs index 1226055eb3..f0e1b471f1 100644 --- a/crates/debugger_ui/src/session/running.rs +++ b/crates/debugger_ui/src/session/running.rs @@ -1107,7 +1107,7 @@ impl RunningState { let request_type = match dap_registry .adapter(&adapter) - .with_context(|| format!("{}: is not a valid adapter name", &adapter)) { + .with_context(|| format!("{adapter}: is not a valid adapter name")) { Ok(adapter) => adapter.request_kind(&config).await, Err(e) => Err(e) }; @@ -1257,7 +1257,7 @@ impl RunningState { let scenario = dap_registry .adapter(&adapter) - .with_context(|| anyhow!("{}: is not a valid adapter name", &adapter))?.config_from_zed_format(zed_config) + .with_context(|| anyhow!("{adapter}: is not a valid adapter name"))?.config_from_zed_format(zed_config) .await?; config = scenario.config; util::merge_non_null_json_value_into(extra_config, &mut config); diff --git a/crates/debugger_ui/src/session/running/variable_list.rs b/crates/debugger_ui/src/session/running/variable_list.rs index 56aed0bb1c..6e8315c7f5 100644 --- a/crates/debugger_ui/src/session/running/variable_list.rs +++ b/crates/debugger_ui/src/session/running/variable_list.rs @@ -1158,7 +1158,7 @@ impl VariableList { }, ) .child( - Label::new(format!("= {}", &value)) + Label::new(format!("= {value}")) .single_line() .truncate() .size(LabelSize::Small) diff --git a/crates/dev_container/src/devcontainer_manifest.rs b/crates/dev_container/src/devcontainer_manifest.rs index 2e844e031e..cd4f24dabe 100644 --- a/crates/dev_container/src/devcontainer_manifest.rs +++ b/crates/dev_container/src/devcontainer_manifest.rs @@ -73,7 +73,7 @@ impl DevContainerManifest { local_project_path: &Path, ) -> Result { let config_path = local_project_path.join(local_config.config_path.clone()); - log::debug!("parsing devcontainer json found in {:?}", &config_path); + log::debug!("parsing devcontainer json found in {config_path:?}"); let devcontainer_contents = context.fs.load(&config_path).await.map_err(|e| { log::error!("Unable to read devcontainer contents: {e}"); DevContainerError::DevContainerParseFailed @@ -591,7 +591,7 @@ impl DevContainerManifest { "No devcontainer-feature.json found in {:?}, no defaults to apply", feature_json_path ); - log::error!("{}", &message); + log::error!("{message}"); return Err(DevContainerError::ResourceFetchFailed); } diff --git a/crates/docs_preprocessor/src/main.rs b/crates/docs_preprocessor/src/main.rs index 4b0c2ca04b..b1f18250bd 100644 --- a/crates/docs_preprocessor/src/main.rs +++ b/crates/docs_preprocessor/src/main.rs @@ -320,7 +320,7 @@ fn template_and_validate_actions(book: &mut Book, errors: &mut HashSet{}", name); }; - format!("{}", &action.human_name) + format!("{}", action.human_name) }) .into_owned() }); diff --git a/crates/edit_prediction_cli/src/example.rs b/crates/edit_prediction_cli/src/example.rs index f7e2f298bf..ae90f23a70 100644 --- a/crates/edit_prediction_cli/src/example.rs +++ b/crates/edit_prediction_cli/src/example.rs @@ -225,7 +225,7 @@ pub fn read_example_files(inputs: &[PathBuf]) -> Vec { buffer } else { std::fs::read_to_string(path) - .unwrap_or_else(|_| panic!("Failed to read path: {:?}", &path)) + .unwrap_or_else(|_| panic!("Failed to read path: {path:?}")) }; let filename = path.file_stem().unwrap().to_string_lossy().to_string(); let ext = if !is_stdin { diff --git a/crates/edit_prediction_cli/src/reorder_patch.rs b/crates/edit_prediction_cli/src/reorder_patch.rs index aed393a15b..cdee444e34 100644 --- a/crates/edit_prediction_cli/src/reorder_patch.rs +++ b/crates/edit_prediction_cli/src/reorder_patch.rs @@ -182,7 +182,7 @@ impl Patch { } if in_header { - patch.header.push_str(format!("{}\n", &line).as_ref()); + patch.header.push_str(format!("{line}\n").as_ref()); continue; } @@ -962,7 +962,7 @@ mod tests { remove_edits(&mut patch, vec![0]); // The line numbers should be adjusted in the subsequent hunks - println!("{}", &patch.to_string()); + println!("{}", patch.to_string()); assert_eq!(patch.hunks[0].header_string(), "@@ -2,6 +2,7 @@"); assert_eq!(patch.hunks[1].header_string(), "@@ -9,6 +10,7 @@ gray"); assert_eq!(patch.hunks[2].header_string(), "@@ -16,4 +18,3 @@ red"); @@ -1155,7 +1155,7 @@ mod tests { apply_edits(&mut patch, vec![1]); // The line numbers should be adjusted in the subsequent hunks - println!("{}", &patch.to_string()); + println!("{}", patch.to_string()); assert_eq!(patch.hunks[0].header_string(), "@@ -1,7 +1,6 @@"); assert_eq!(patch.hunks[1].header_string(), "@@ -10,6 +9,7 @@ gray"); assert_eq!(patch.hunks[2].header_string(), "@@ -17,4 +17,3 @@ red"); diff --git a/crates/eval_cli/Dockerfile b/crates/eval_cli/Dockerfile index d67453f1fa..69a1646177 100644 --- a/crates/eval_cli/Dockerfile +++ b/crates/eval_cli/Dockerfile @@ -7,14 +7,14 @@ # Or use the helper script: # crates/eval_cli/script/build-linux -FROM rust:1.95.0@sha256:f49565f188ee00bc2a18dd418183f2c5f23ef7d6e691890517ed341a598f67c3 AS builder +FROM rust:1.97.1@sha256:3382bd20aa942806c533e9a73cd000474fb3ef173f71e684cc9b942675781769 AS builder ARG CARGO_ZIGBUILD_VERSION=0.22.3 WORKDIR /app # Pre-install the toolchain specified in rust-toolchain.toml so it is cached. -RUN rustup toolchain install 1.95.0 --profile minimal \ +RUN rustup toolchain install 1.97.1 --profile minimal \ --component rustfmt --component clippy --component rust-analyzer --component rust-src \ --target wasm32-wasip2 --target wasm32-unknown-unknown --target x86_64-unknown-linux-musl --target x86_64-unknown-linux-gnu diff --git a/crates/fs/src/fs.rs b/crates/fs/src/fs.rs index c321f8704e..711aa53f27 100644 --- a/crates/fs/src/fs.rs +++ b/crates/fs/src/fs.rs @@ -2610,7 +2610,7 @@ impl FakeFs { state .event_txs .iter() - .filter_map(|(path, tx)| Some(path.clone()).filter(|_| !tx.is_closed())) + .filter_map(|(path, tx)| (!tx.is_closed()).then_some(path.clone())) .collect() } diff --git a/crates/git_hosting_providers/src/providers/chromium.rs b/crates/git_hosting_providers/src/providers/chromium.rs index 4f20ce0403..3ab6e557f1 100644 --- a/crates/git_hosting_providers/src/providers/chromium.rs +++ b/crates/git_hosting_providers/src/providers/chromium.rs @@ -182,7 +182,7 @@ impl GitHostingProvider for Chromium { let mut avatar_url = Url::parse(&format!( "{CHROMIUM_REVIEW_URL}/accounts/{}/avatar", - &author.id + author.id ))?; avatar_url.set_query(Some("size=128")); diff --git a/crates/git_ui/src/git_panel.rs b/crates/git_ui/src/git_panel.rs index 6735bb57dd..4fd0670580 100644 --- a/crates/git_ui/src/git_panel.rs +++ b/crates/git_ui/src/git_panel.rs @@ -8236,7 +8236,9 @@ impl Panel for GitPanel { } fn icon(&self, _: &Window, cx: &App) -> Option { - Some(ui::IconName::GitBranch).filter(|_| GitPanelSettings::get_global(cx).button) + GitPanelSettings::get_global(cx) + .button + .then_some(ui::IconName::GitBranch) } fn icon_tooltip(&self, _window: &Window, _cx: &App) -> Option<&'static str> { diff --git a/crates/google_ai/src/google_ai.rs b/crates/google_ai/src/google_ai.rs index ce41d8dc29..fb88d2ecb5 100644 --- a/crates/google_ai/src/google_ai.rs +++ b/crates/google_ai/src/google_ai.rs @@ -473,7 +473,7 @@ impl Serialize for ModelName { where S: Serializer, { - serializer.serialize_str(&format!("{MODEL_NAME_PREFIX}{}", &self.model_id)) + serializer.serialize_str(&format!("{MODEL_NAME_PREFIX}{}", self.model_id)) } } diff --git a/crates/gpui/examples/hello_world.rs b/crates/gpui/examples/hello_world.rs index 50d56ec8df..aa67ada33f 100644 --- a/crates/gpui/examples/hello_world.rs +++ b/crates/gpui/examples/hello_world.rs @@ -25,7 +25,7 @@ impl Render for HelloWorld { .border_color(rgb(0x0000ff)) .text_xl() .text_color(rgb(0xffffff)) - .child(format!("Hello, {}!", &self.text)) + .child(format!("Hello, {}!", self.text)) .child( div() .flex() diff --git a/crates/gpui/examples/mouse_pressure.rs b/crates/gpui/examples/mouse_pressure.rs index 24c3906f61..d3519b2a54 100644 --- a/crates/gpui/examples/mouse_pressure.rs +++ b/crates/gpui/examples/mouse_pressure.rs @@ -26,8 +26,8 @@ impl Render for MousePressureExample { .border_color(rgb(0x0000ff)) .text_xl() .text_color(rgb(0xffffff)) - .child(format!("Pressure stage: {:?}", &self.pressure_stage)) - .child(format!("Pressure amount: {:.2}", &self.pressure_amount)) + .child(format!("Pressure stage: {:?}", self.pressure_stage)) + .child(format!("Pressure amount: {:.2}", self.pressure_amount)) .on_mouse_pressure(cx.listener(Self::on_mouse_pressure)) } } diff --git a/crates/gpui/examples/move_entity_between_windows.rs b/crates/gpui/examples/move_entity_between_windows.rs index 6ad3c8fab0..eaefabfe29 100644 --- a/crates/gpui/examples/move_entity_between_windows.rs +++ b/crates/gpui/examples/move_entity_between_windows.rs @@ -105,7 +105,7 @@ impl Render for HelloWorld { .items_center() .text_xl() .text_color(rgb(0xffffff)) - .child(format!("Hello, {}!", &self.text)) + .child(format!("Hello, {}!", self.text)) .child(format!("Rendering in window: {window_id}")) .child(format!("Ticks observed by entity: {}", self.tick_count)) .child(format!("Moves observed by entity: {}", self.move_count)) diff --git a/crates/gpui_macos/build.rs b/crates/gpui_macos/build.rs index d5c1893f4c..aee655fe50 100644 --- a/crates/gpui_macos/build.rs +++ b/crates/gpui_macos/build.rs @@ -117,7 +117,7 @@ mod macos_build { let shader_source_path = "./src/shaders.metal"; let shader_path = PathBuf::from(shader_source_path); stitch_header(header_path, &shader_path).unwrap(); - println!("cargo:rerun-if-changed={}", &shader_source_path); + println!("cargo:rerun-if-changed={shader_source_path}"); } #[cfg(not(feature = "runtime_shaders"))] diff --git a/crates/gpui_util/src/lib.rs b/crates/gpui_util/src/lib.rs index 94b0f5609f..c4127e701f 100644 --- a/crates/gpui_util/src/lib.rs +++ b/crates/gpui_util/src/lib.rs @@ -584,7 +584,7 @@ where F: Fn(&T, &T) -> std::cmp::Ordering, { if limit == 0 { - items.truncate(0); + items.clear(); } if items.len() <= limit { items.sort_by(compare); diff --git a/crates/language/src/text_diff.rs b/crates/language/src/text_diff.rs index 4e8239672b..65a9d2dfa1 100644 --- a/crates/language/src/text_diff.rs +++ b/crates/language/src/text_diff.rs @@ -112,7 +112,7 @@ impl<'a> OffsetUnifiedDiffBuilder<'a> { self.after_hunk_len, ) .unwrap(); - write!(&mut self.dst, "{}", &self.buffer).unwrap(); + write!(&mut self.dst, "{}", self.buffer).unwrap(); self.buffer.clear(); self.before_hunk_len = 0; self.after_hunk_len = 0; diff --git a/crates/languages/src/rust.rs b/crates/languages/src/rust.rs index dde5e0b6dd..b0693f7107 100644 --- a/crates/languages/src/rust.rs +++ b/crates/languages/src/rust.rs @@ -269,7 +269,7 @@ impl RustLspAdapter { "{}-{}-{}.{}", SERVER_NAME, std::env::consts::ARCH, - &arch_server_name, + arch_server_name, extension ) } diff --git a/crates/livekit_client/examples/test_app.rs b/crates/livekit_client/examples/test_app.rs index f21bc9d320..a07d212111 100644 --- a/crates/livekit_client/examples/test_app.rs +++ b/crates/livekit_client/examples/test_app.rs @@ -360,9 +360,9 @@ impl Render for LivekitWindow { .px_2() .bg(rgb(0x8888ff)) .child(SharedString::from(if state.speaking { - format!("{} (speaking)", &identity.0) + format!("{} (speaking)", identity.0) } else if state.muted { - format!("{} (muted)", &identity.0) + format!("{} (muted)", identity.0) } else { identity.0.clone() })) diff --git a/crates/lsp/src/lsp.rs b/crates/lsp/src/lsp.rs index 12d048c1d5..f31e9fce8b 100644 --- a/crates/lsp/src/lsp.rs +++ b/crates/lsp/src/lsp.rs @@ -448,7 +448,7 @@ impl LanguageServer { {:?}, working directory: {:?}, args: {:?}", binary.path, working_dir, - &binary.arguments + binary.arguments ); let mut command = util::command::new_command(&binary.path); command @@ -827,10 +827,11 @@ impl LanguageServer { inlay_hint: Some(InlayHintWorkspaceClientCapabilities { refresh_support: Some(true), }), - diagnostics: Some(DiagnosticWorkspaceClientCapabilities { - refresh_support: Some(true), - }) - .filter(|_| pull_diagnostics), + diagnostics: pull_diagnostics.then_some( + DiagnosticWorkspaceClientCapabilities { + refresh_support: Some(true), + }, + ), code_lens: Some(CodeLensWorkspaceClientCapabilities { refresh_support: Some(true), }), @@ -1016,11 +1017,10 @@ impl LanguageServer { dynamic_registration: Some(true), ..DocumentSymbolClientCapabilities::default() }), - diagnostic: Some(DiagnosticClientCapabilities { + diagnostic: pull_diagnostics.then_some(DiagnosticClientCapabilities { dynamic_registration: Some(true), related_document_support: Some(true), - }) - .filter(|_| pull_diagnostics), + }), color_provider: Some(DocumentColorClientCapabilities { dynamic_registration: Some(true), }), diff --git a/crates/outline_panel/src/outline_panel.rs b/crates/outline_panel/src/outline_panel.rs index 49018c5b92..008fa560df 100644 --- a/crates/outline_panel/src/outline_panel.rs +++ b/crates/outline_panel/src/outline_panel.rs @@ -2282,7 +2282,7 @@ impl OutlinePanel { ) -> Stateful
{ let item_id = ElementId::from(SharedString::from(format!( "{:?}|{:?}", - outline.range, &outline.text, + outline.range, outline.text, ))); let label_element = outline::render_item( diff --git a/crates/project/src/debugger/session.rs b/crates/project/src/debugger/session.rs index 1f2e10cd33..634feeccd9 100644 --- a/crates/project/src/debugger/session.rs +++ b/crates/project/src/debugger/session.rs @@ -2780,7 +2780,7 @@ impl Session { Ok(response) => { let event = dap::OutputEvent { category: None, - output: format!("< {}", &response.result), + output: format!("< {}", response.result), group: None, variables_reference: Some(response.variables_reference), source: None, diff --git a/crates/project/src/worktree_store.rs b/crates/project/src/worktree_store.rs index 2158480bcc..e0367051e0 100644 --- a/crates/project/src/worktree_store.rs +++ b/crates/project/src/worktree_store.rs @@ -1402,7 +1402,7 @@ impl WorktreeStore { let entry_id = ProjectEntryId::from_proto(request.entry_id); let new_worktree_id = WorktreeId::from_proto(request.new_worktree_id); let rel_path = RelPath::from_unix_str(&request.new_path) - .with_context(|| format!("received invalid relative path {:?}", &request.new_path))?; + .with_context(|| format!("received invalid relative path {:?}", request.new_path))?; let (scan_id, task) = this.update(&mut cx, |this, cx| { let worktree = this diff --git a/crates/project/tests/integration/project_tests.rs b/crates/project/tests/integration/project_tests.rs index 29f76a4595..701ff7b038 100644 --- a/crates/project/tests/integration/project_tests.rs +++ b/crates/project/tests/integration/project_tests.rs @@ -9223,7 +9223,7 @@ async fn test_multiple_language_server_hovers(cx: &mut gpui::TestAppContext) { let new_server = language_servers[i].next().await.unwrap_or_else(|| { panic!( "Failed to get language server #{i} with name {}", - &language_server_names[i] + language_server_names[i] ) }); let new_server_name = new_server.server.name(); @@ -9618,7 +9618,7 @@ async fn test_multiple_language_server_actions(cx: &mut gpui::TestAppContext) { let new_server = language_server_rxs[i].next().await.unwrap_or_else(|| { panic!( "Failed to get language server #{i} with name {}", - &language_server_names[i] + language_server_names[i] ) }); let new_server_name = new_server.server.name(); diff --git a/crates/project_benchmarks/src/main.rs b/crates/project_benchmarks/src/main.rs index 01dc141904..31b8bec2cb 100644 --- a/crates/project_benchmarks/src/main.rs +++ b/crates/project_benchmarks/src/main.rs @@ -141,7 +141,7 @@ fn main() -> Result<(), anyhow::Error> { cx.spawn(async move |cx| { let project = if let Some(ssh_target) = args.ssh { - println!("Setting up SSH connection for {}", &ssh_target); + println!("Setting up SSH connection for {ssh_target}"); let ssh_connection_options = SshConnectionOptions::parse_command_line(&ssh_target)?; let connection_options = remote::RemoteConnectionOptions::from(ssh_connection_options); diff --git a/crates/project_panel/src/tests/undo.rs b/crates/project_panel/src/tests/undo.rs index 070b31de6a..6f419c0750 100644 --- a/crates/project_panel/src/tests/undo.rs +++ b/crates/project_panel/src/tests/undo.rs @@ -32,7 +32,7 @@ fn path(path: impl AsRef) -> String { { let mut path = path.replace("/", "\\"); if path.starts_with("\\") { - path = format!("C:{}", &path); + path = format!("C:{path}"); } path } diff --git a/crates/remote/src/remote_client.rs b/crates/remote/src/remote_client.rs index 239e978593..f63bfa4448 100644 --- a/crates/remote/src/remote_client.rs +++ b/crates/remote/src/remote_client.rs @@ -921,7 +921,7 @@ impl RemoteClient { } fn set_state(&mut self, state: State, cx: &mut Context) { - log::info!("setting state to '{}'", &state); + log::info!("setting state to '{state}'"); let is_reconnect_exhausted = state.is_reconnect_exhausted(); let is_server_not_running = state.is_server_not_running(); diff --git a/crates/remote/src/transport/ssh.rs b/crates/remote/src/transport/ssh.rs index 29aaf31cc8..1ac2e0d60a 100644 --- a/crates/remote/src/transport/ssh.rs +++ b/crates/remote/src/transport/ssh.rs @@ -1899,7 +1899,7 @@ fn build_command_posix( )?; for arg in input_args { let arg = ssh_shell_kind.try_quote(&arg).context("shell quoting")?; - write!(exec, " {}", &arg)?; + write!(exec, " {arg}")?; } } else { write!(exec, "{ssh_shell} -l")?; @@ -1993,7 +1993,7 @@ fn build_command_windows( )?; for arg in input_args { let arg = shell_kind.try_quote(arg).context("shell quoting")?; - write!(exec, " {}", &arg)?; + write!(exec, " {arg}")?; } } else { // Launch an interactive shell session diff --git a/crates/remote/src/transport/wsl.rs b/crates/remote/src/transport/wsl.rs index 9b2b69db24..61d676bde5 100644 --- a/crates/remote/src/transport/wsl.rs +++ b/crates/remote/src/transport/wsl.rs @@ -559,7 +559,7 @@ impl RemoteConnection for WslRemoteConnection { )?; for arg in args { let arg = shell_kind.try_quote(&arg).context("shell quoting")?; - write!(exec, " {}", &arg)?; + write!(exec, " {arg}")?; } } else { write!(&mut exec, "{} -l", self.shell)?; diff --git a/crates/remote_server/src/server.rs b/crates/remote_server/src/server.rs index ffbea71cfe..bd5bda5c26 100644 --- a/crates/remote_server/src/server.rs +++ b/crates/remote_server/src/server.rs @@ -609,7 +609,7 @@ pub fn execute_run( ); write_pid_file(&pid_file, pid) - .with_context(|| format!("failed to write pid file: {:?}", &pid_file))?; + .with_context(|| format!("failed to write pid file: {pid_file:?}"))?; let listeners = ServerListeners::new(stdin_socket, stdout_socket, stderr_socket)?; diff --git a/crates/repl/src/notebook/cell.rs b/crates/repl/src/notebook/cell.rs index 92e4d42c73..f323b87e52 100644 --- a/crates/repl/src/notebook/cell.rs +++ b/crates/repl/src/notebook/cell.rs @@ -1056,8 +1056,7 @@ impl RunnableCell for CodeCell { } fn execution_count(&self) -> Option { - self.execution_count - .and_then(|count| if count > 0 { Some(count) } else { None }) + self.execution_count.filter(|&count| count > 0) } fn set_execution_count(&mut self, count: i32) -> &mut Self { diff --git a/crates/settings/src/keymap_file.rs b/crates/settings/src/keymap_file.rs index 72d5606af4..c448fb92d7 100644 --- a/crates/settings/src/keymap_file.rs +++ b/crates/settings/src/keymap_file.rs @@ -432,7 +432,7 @@ impl KeymapFile { Err(InvalidKeystrokeError { keystroke }) => { return Err(format!( "invalid keystroke {}. {}", - MarkdownInlineCode(&format!("\"{}\"", &keystroke)), + MarkdownInlineCode(&format!("\"{keystroke}\"")), KEYSTROKE_PARSE_EXPECTED_MESSAGE )); } @@ -485,7 +485,7 @@ impl KeymapFile { .map_err(|InvalidKeystrokeError { keystroke }| { format!( "invalid keystroke {}. {}", - MarkdownInlineCode(&format!("\"{}\"", &keystroke)), + MarkdownInlineCode(&format!("\"{keystroke}\"")), KEYSTROKE_PARSE_EXPECTED_MESSAGE ) }) @@ -566,14 +566,14 @@ impl KeymapFile { Err(ActionBuildError::NotFound { name }) => { return Err(format!( "didn't find an action named {}.", - MarkdownInlineCode(&format!("\"{}\"", &name)) + MarkdownInlineCode(&format!("\"{name}\"")) )); } Err(ActionBuildError::BuildError { name, error }) => match action_input_string { Some(action_input_string) => { return Err(format!( "can't build {} action from input value {}: {}", - MarkdownInlineCode(&format!("\"{}\"", &name)), + MarkdownInlineCode(&format!("\"{name}\"")), MarkdownInlineCode(&action_input_string), MarkdownEscaped(&error.to_string()) )); @@ -581,7 +581,7 @@ impl KeymapFile { None => { return Err(format!( "can't build {} action - it requires input data via [name, input]: {}", - MarkdownInlineCode(&format!("\"{}\"", &name)), + MarkdownInlineCode(&format!("\"{name}\"")), MarkdownEscaped(&error.to_string()) )); } diff --git a/crates/sidebar/src/sidebar_tests.rs b/crates/sidebar/src/sidebar_tests.rs index aff7eaff3f..2bc99086ad 100644 --- a/crates/sidebar/src/sidebar_tests.rs +++ b/crates/sidebar/src/sidebar_tests.rs @@ -561,12 +561,7 @@ fn visible_entries_as_strings( "" }; match entry { - ListEntry::ProjectHeader { - label, - key, - highlight_positions: _, - .. - } => { + ListEntry::ProjectHeader { label, key, .. } => { let icon = if sidebar.is_group_collapsed(key, cx) { ">" } else { diff --git a/crates/sqlez_macros/src/sqlez_macros.rs b/crates/sqlez_macros/src/sqlez_macros.rs index 5ddfe4cd87..0df3baca46 100644 --- a/crates/sqlez_macros/src/sqlez_macros.rs +++ b/crates/sqlez_macros/src/sqlez_macros.rs @@ -27,7 +27,7 @@ pub fn sql(tokens: TokenStream) -> TokenStream { if let Some((error, error_offset)) = error { create_error(spans, error_offset, error, &formatted_sql) } else { - format!("r#\"{}\"#", &formatted_sql).parse().unwrap() + format!("r#\"{formatted_sql}\"#").parse().unwrap() } } diff --git a/crates/sum_tree/src/cursor.rs b/crates/sum_tree/src/cursor.rs index ec2ded5fcf..06cbfd5874 100644 --- a/crates/sum_tree/src/cursor.rs +++ b/crates/sum_tree/src/cursor.rs @@ -75,7 +75,7 @@ where pub fn reset(&mut self) { self.did_seek = false; self.at_end = self.tree.is_empty(); - self.stack.truncate(0); + self.stack.clear(); self.position = D::zero(self.cx); } diff --git a/crates/terminal/src/alacritty/hyperlinks.rs b/crates/terminal/src/alacritty/hyperlinks.rs index 1dbec598c0..228f813f67 100644 --- a/crates/terminal/src/alacritty/hyperlinks.rs +++ b/crates/terminal/src/alacritty/hyperlinks.rs @@ -1772,7 +1772,7 @@ mod tests { let format_path_with_position_and_match = |path_with_position: &PathWithPosition, hyperlink_match: &Match| { let mut result = - format!("Path = «{}»", &path_with_position.path.to_string_lossy()); + format!("Path = «{}»", path_with_position.path.to_string_lossy()); if let Some(row) = path_with_position.row { result += &format!(", line = {row}"); if let Some(column) = path_with_position.column { diff --git a/crates/text/src/patch.rs b/crates/text/src/patch.rs index 376d284473..4b72d10f3c 100644 --- a/crates/text/src/patch.rs +++ b/crates/text/src/patch.rs @@ -598,15 +598,15 @@ mod tests { patches.push(Patch(edits)); } - log::info!("old patch: {:?}", &patches[0]); - log::info!("new patch: {:?}", &patches[1]); + log::info!("old patch: {:?}", patches[0]); + log::info!("new patch: {:?}", patches[1]); log::info!("initial chars: {:?}", initial_chars); log::info!("final chars: {:?}", expected_chars); // Compose the patches, and verify that it has the same effect as applying the // two patches separately. let composed = patches[0].compose(&patches[1]); - log::info!("composed patch: {:?}", &composed); + log::info!("composed patch: {composed:?}"); let mut actual_chars = initial_chars; for edit in composed.0 { diff --git a/crates/toolchain_selector/src/active_toolchain.rs b/crates/toolchain_selector/src/active_toolchain.rs index 7f157e2689..efcd65f0f9 100644 --- a/crates/toolchain_selector/src/active_toolchain.rs +++ b/crates/toolchain_selector/src/active_toolchain.rs @@ -248,7 +248,7 @@ impl Render for ActiveToolchain { }); } })) - .tooltip(Tooltip::text(format!("Select {}", &self.term))), + .tooltip(Tooltip::text(format!("Select {}", self.term))), ) } } diff --git a/crates/vim/src/command.rs b/crates/vim/src/command.rs index 316128d9cb..c7bd28700d 100644 --- a/crates/vim/src/command.rs +++ b/crates/vim/src/command.rs @@ -1949,7 +1949,7 @@ pub fn command_interceptor( + if parsed_query.has_bang { "!" } else { "" }; let space = if parsed_query.has_space { " " } else { "" }; - let string = format!("{}{}{}", &display_string, &space, &parsed_query.args); + let string = format!("{}{}{}", display_string, space, parsed_query.args); let positions = generate_positions(&string, &(range_prefix.clone() + query)); let results = vec![CommandInterceptItem { diff --git a/crates/workspace/src/pane.rs b/crates/workspace/src/pane.rs index 7ebb0530f7..71075a56dd 100644 --- a/crates/workspace/src/pane.rs +++ b/crates/workspace/src/pane.rs @@ -2048,7 +2048,7 @@ impl Pane { ); window.prompt( PromptLevel::Warning, - &format!("Unable to save file: {}", &err), + &format!("Unable to save file: {err}"), Some(&detail), &["Close Without Saving", "Cancel"], cx, diff --git a/crates/worktree/src/worktree.rs b/crates/worktree/src/worktree.rs index 15c665ec2e..9f4d47ca5b 100644 --- a/crates/worktree/src/worktree.rs +++ b/crates/worktree/src/worktree.rs @@ -2895,13 +2895,7 @@ impl Snapshot { pub fn entry_for_path(&self, path: &RelPath) -> Option<&Entry> { let entry = self.traverse_from_path(true, true, true, path).entry(); - entry.and_then(|entry| { - if entry.path.as_ref() == path { - Some(entry) - } else { - None - } - }) + entry.filter(|&entry| entry.path.as_ref() == path) } /// Whether `path` is gitignored, or lies inside a gitignored directory. @@ -3017,7 +3011,7 @@ impl LocalSnapshot { Err(error) => { log::error!( "error loading .gitignore file {:?} - {:?}", - &entry.path, + entry.path, error ); } diff --git a/crates/worktree/tests/integration/worktree_tests.rs b/crates/worktree/tests/integration/worktree_tests.rs index dcd303e5fd..d3fbf2824b 100644 --- a/crates/worktree/tests/integration/worktree_tests.rs +++ b/crates/worktree/tests/integration/worktree_tests.rs @@ -3352,7 +3352,7 @@ fn randomly_mutate_worktree( } else { log::info!( "overwriting file {:?} ({})", - &entry.path, + entry.path, entry.id.to_usize() ); let task = worktree.write_file( diff --git a/crates/zeta_prompt/src/udiff.rs b/crates/zeta_prompt/src/udiff.rs index 3df1109bf2..a13f495259 100644 --- a/crates/zeta_prompt/src/udiff.rs +++ b/crates/zeta_prompt/src/udiff.rs @@ -289,7 +289,7 @@ impl<'a> OffsetUnifiedDiffBuilder<'a> { self.after_hunk_len, ) .unwrap(); - write!(&mut self.dst, "{}", &self.buffer).unwrap(); + write!(&mut self.dst, "{}", self.buffer).unwrap(); self.buffer.clear(); self.before_hunk_len = 0; self.after_hunk_len = 0; diff --git a/extensions/proto/src/language_servers/buf.rs b/extensions/proto/src/language_servers/buf.rs index 92106298d3..8a2381db70 100644 --- a/extensions/proto/src/language_servers/buf.rs +++ b/extensions/proto/src/language_servers/buf.rs @@ -88,10 +88,7 @@ impl BufLsp { .into_iter() .find(|asset| asset.name == release_name) .ok_or_else(|| { - format!( - "Could not find asset with name {} in buf CLI release", - &release_name - ) + format!("Could not find asset with name {release_name} in buf CLI release") })?; zed::download_file( diff --git a/extensions/proto/src/language_servers/protols.rs b/extensions/proto/src/language_servers/protols.rs index 90d365eae7..25787acfff 100644 --- a/extensions/proto/src/language_servers/protols.rs +++ b/extensions/proto/src/language_servers/protols.rs @@ -91,10 +91,7 @@ impl ProtoLs { .into_iter() .find(|asset| asset.name == release_name) .ok_or_else(|| { - format!( - "Could not find asset with name {} in Protols release", - &release_name - ) + format!("Could not find asset with name {release_name} in Protols release") })?; zed::download_file(&download_target.download_url, &version_dir, file_type)?; diff --git a/flake.lock b/flake.lock index 7466ae5227..a0a2137505 100644 --- a/flake.lock +++ b/flake.lock @@ -79,11 +79,11 @@ ] }, "locked": { - "lastModified": 1777346187, - "narHash": "sha256-oVxyGjpiIsrXhWTJVUOs38fZQkLjd0nZGOY9K7Kfot8=", + "lastModified": 1786247265, + "narHash": "sha256-cVTcTqAhzSNMOVddtBhFpuv+Vx6/SgrhgZWJiI61H24=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "146e7bf7569b8288f24d41d806b9f584f7cfd5b5", + "rev": "6df7076ea0f5697e3242719a4c71211f00411cf5", "type": "github" }, "original": { diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 2dd2a0e671..78f34e4d69 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,5 +1,5 @@ [toolchain] -channel = "1.95.0" +channel = "1.97.1" profile = "minimal" components = [ "rustfmt", "clippy", "rust-analyzer", "rust-src" ] targets = [ diff --git a/tooling/xtask/src/tasks/workflows/vars.rs b/tooling/xtask/src/tasks/workflows/vars.rs index df44721010..425ad04d27 100644 --- a/tooling/xtask/src/tasks/workflows/vars.rs +++ b/tooling/xtask/src/tasks/workflows/vars.rs @@ -157,7 +157,7 @@ impl<'a> PathContextCondition<'a> { job: job.job.add_need(set_by_step.clone()).cond(Expression::new( format!( "needs.{}.outputs.{} == 'true' {merge_queue_condition}", - &set_by_step, + set_by_step, self.condition.name, merge_queue_condition = self .run_in_merge_queue