Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Bump rustc to 1.97 (#62395)

Kirill Bulatov1271f8b0e8f3
diff --git a/Dockerfile-collab b/Dockerfile-collab
index fbbcb0df048..5250f521026 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 5fe605176a8..fa61ac4d1bf 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 0c5996a6f69..df48508fbde 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 7f9ff087b38..2c19e111571 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::<Vec<_>>()
diff --git a/crates/call/src/call_impl/room.rs b/crates/call/src/call_impl/room.rs
index 108c5a46304..0c9667bd0e9 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 7273da72222..c12ea19e39c 100644
--- a/crates/client/src/client.rs
+++ b/crates/client/src/client.rs
@@ -67,7 +67,7 @@ static ZED_RPC_URL: LazyLock<Option<String>> = LazyLock::new(|| std::env::var("Z
pub static IMPERSONATE_LOGIN: LazyLock<Option<String>> = 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<bool> = LazyLock::new(|| std::env::var("ZED_WEB_LOGIN").is_ok());
@@ -75,7 +75,7 @@ pub static USE_WEB_LOGIN: LazyLock<bool> = LazyLock::new(|| std::env::var("ZED_W
pub static ADMIN_API_TOKEN: LazyLock<Option<String>> = 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<Option<PathBuf>> =
diff --git a/crates/collab/src/db/queries/channels.rs b/crates/collab/src/db/queries/channels.rs
index 03f561d7295..d54b4f6df1b 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 ff415a71dd5..ac8bbd77b84 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 61541aa5a10..8dfa930dcd4 100644
--- a/crates/collab/src/services/user_service.rs
+++ b/crates/collab/src/services/user_service.rs
@@ -68,10 +68,7 @@ impl CloudUserService {
) -> Result<T> {
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 e6c377e3d45..cc092f3e23e 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 d8e66e7a5ee..92fef2f79e2 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::<Vec<_>>();
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 14d60627179..655c35abb4f 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 43f5e5656e5..163e463e590 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 3761f19ec4a..4e41ed98e25 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::<AnyRequest>(&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 a9be4c07a26..0a3f4bcc319 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 0f4bb937c1b..70cf30878ae 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 726c6268929..46831951d0a 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 bb72a8dd172..2254f2bb430 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 1226055eb3f..f0e1b471f15 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 56aed0bb1c7..6e8315c7f5e 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 2e844e031ec..cd4f24dabe0 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<Self, DevContainerError> {
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 4b0c2ca04bc..b1f18250bd4 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<Preproces
}
return format!("<code class=\"hljs\">{}</code>", name);
};
- format!("<code class=\"hljs\">{}</code>", &action.human_name)
+ format!("<code class=\"hljs\">{}</code>", action.human_name)
})
.into_owned()
});
diff --git a/crates/edit_prediction_cli/src/example.rs b/crates/edit_prediction_cli/src/example.rs
index f7e2f298bf9..ae90f23a709 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<Example> {
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 aed393a15b0..cdee444e342 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 d67453f1faa..69a16461775 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 c321f8704e9..711aa53f279 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 4f20ce0403f..3ab6e557f1b 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 6735bb57ddc..4fd06705801 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<ui::IconName> {
- 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 ce41d8dc29f..fb88d2ecb5c 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 50d56ec8df1..aa67ada33ff 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 24c3906f61e..d3519b2a549 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 6ad3c8fab0c..eaefabfe296 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 d5c1893f4ce..aee655fe50e 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 94b0f5609f0..c4127e701f0 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 4e8239672b2..65a9d2dfa19 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 dde5e0b6dda..b0693f7107a 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 f21bc9d3203..a07d212111e 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 12d048c1d5b..f31e9fce8b3 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 49018c5b926..008fa560df6 100644
--- a/crates/outline_panel/src/outline_panel.rs
+++ b/crates/outline_panel/src/outline_panel.rs
@@ -2282,7 +2282,7 @@ impl OutlinePanel {
) -> Stateful<Div> {
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 1f2e10cd337..634feeccd9d 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 2158480bcc9..e0367051e05 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 29f76a45950..701ff7b0381 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 01dc141904e..31b8bec2cbe 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 070b31de6a5..6f419c0750a 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<str>) -> 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 239e9785931..f63bfa4448d 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<Self>) {
- 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 29aaf31cc81..1ac2e0d60a8 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 9b2b69db241..61d676bde54 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 ffbea71cfe1..bd5bda5c268 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 92e4d42c73e..f323b87e52c 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<i32> {
- 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 72d5606af43..c448fb92d7c 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 aff7eaff3f8..2bc99086ad7 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 5ddfe4cd87e..0df3baca466 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 ec2ded5fcfc..06cbfd58746 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 1dbec598c09..228f813f672 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 376d284473d..4b72d10f3cf 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 7f157e26895..efcd65f0f9f 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 316128d9cb1..c7bd28700d1 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 7ebb0530f71..71075a56ddf 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 15c665ec2eb..9f4d47ca5bd 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 dcd303e5fd2..d3fbf2824bc 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 3df1109bf25..a13f4952590 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 92106298d3d..8a2381db705 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 90d365eae7d..25787acfff7 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 7466ae52271..a0a2137505f 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 2dd2a0e6716..78f34e4d694 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 df44721010b..425ad04d27e 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