Bump rustc to 1.97 (#62395)

Release Notes:

- N/A
This commit is contained in:
Kirill Bulatov authored and GitHub committed 2026-08-09 22:29:52 +00:00
1 parent 731db7357d
commit 3692029a80
66 files changed
+121 -147

No files matched your search

+1 -1
View File
@@ -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 . .
@@ -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
);
}
+6 -6
View File
@@ -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
)));
}
@@ -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<_>>()
+2 -2
View File
@@ -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 {
+2 -2
View File
@@ -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>> =
+1 -1
View File
@@ -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();
+7 -9
View File
@@ -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()
}
}
}
+5 -8
View File
@@ -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,
@@ -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();
@@ -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()
+4 -4
View File
@@ -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)
@@ -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(
+2 -2
View File
@@ -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) {
+2 -2
View File
@@ -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();
+1 -1
View File
@@ -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));
+2 -2
View File
@@ -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(_) => {}
+1 -1
View File
@@ -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
);
};
}
+2 -2
View File
@@ -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);
@@ -1158,7 +1158,7 @@ impl VariableList {
},
)
.child(
Label::new(format!("= {}", &value))
Label::new(format!("= {value}"))
.single_line()
.truncate()
.size(LabelSize::Small)
@@ -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);
}
+1 -1
View File
@@ -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()
});
+1 -1
View File
@@ -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 {
@@ -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");
+2 -2
View File
@@ -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
+1 -1
View File
@@ -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()
}
@@ -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"));
+3 -1
View File
@@ -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> {
+1 -1
View File
@@ -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))
}
}
+1 -1
View File
@@ -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()
+2 -2
View File
@@ -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))
}
}
@@ -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))
+1 -1
View File
@@ -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"))]
+1 -1
View File
@@ -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);
+1 -1
View File
@@ -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;
+1 -1
View File
@@ -269,7 +269,7 @@ impl RustLspAdapter {
"{}-{}-{}.{}",
SERVER_NAME,
std::env::consts::ARCH,
&arch_server_name,
arch_server_name,
extension
)
}
+2 -2
View File
@@ -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()
}))
+8 -8
View File
@@ -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),
}),
+1 -1
View File
@@ -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(
+1 -1
View File
@@ -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,
+1 -1
View File
@@ -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
@@ -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();
+1 -1
View File
@@ -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);
+1 -1
View File
@@ -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
}
+1 -1
View File
@@ -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();
+2 -2
View File
@@ -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
+1 -1
View File
@@ -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)?;
+1 -1
View File
@@ -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)?;
+1 -2
View File
@@ -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 {
+5 -5
View File
@@ -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())
));
}
+1 -6
View File
@@ -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 {
+1 -1
View File
@@ -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()
}
}
+1 -1
View File
@@ -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);
}
+1 -1
View File
@@ -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 {
+3 -3
View File
@@ -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 {
@@ -248,7 +248,7 @@ impl Render for ActiveToolchain {
});
}
}))
.tooltip(Tooltip::text(format!("Select {}", &self.term))),
.tooltip(Tooltip::text(format!("Select {}", self.term))),
)
}
}
+1 -1
View File
@@ -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 {
+1 -1
View File
@@ -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,
+2 -8
View File
@@ -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
);
}
@@ -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(
+1 -1
View File
@@ -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;
+1 -4
View File
@@ -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(
@@ -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)?;
Generated
+3 -3
View File
@@ -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": {
+1 -1
View File
@@ -1,5 +1,5 @@
[toolchain]
channel = "1.95.0"
channel = "1.97.1"
profile = "minimal"
components = [ "rustfmt", "clippy", "rust-analyzer", "rust-src" ]
targets = [
+1 -1
View File
@@ -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