From f73feed9de36c5e3eb82aa89baa8eaef5ffc9c98 Mon Sep 17 00:00:00 2001 From: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com> Date: Mon, 2 Nov 2026 15:51:56 +0000 Subject: [PATCH] http_client: Remove anyhow reexports (#66430) ## Summary What problem does this solve, how, and why does this change matter? Use "Closes #123" for each issue resolved. Include artifacts produced when testing: before/after screenshots, GIFs, videos, benchmarks. ## Testing Manually test your changes; report results, mention platforms if relevant. How can reviewers test this easily? Include setup and steps. ## Self-review - [ ] I've reviewed my diff for quality, security, reliability, and performance. - [ ] UI changes follow the [checklist](https://zed.dev/docs/development/ui-checklist). - [ ] Tests cover the new or changed behavior. Release Notes: - [GPUI] http_client no longer re-exports anyhow types. --------- Co-authored-by: Amp --- Cargo.lock | 1 - crates/dev_container/src/lib.rs | 5 +++-- crates/dev_container/src/oci.rs | 3 ++- crates/http_client/src/http_client.rs | 2 +- crates/language_model/Cargo.toml | 1 - crates/language_model/src/fake_provider.rs | 3 +-- 6 files changed, 7 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 04f5c85a594..a069b149791 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -9555,7 +9555,6 @@ dependencies = [ "futures 0.3.34", "gpui", "gpui_util", - "http_client", "icons", "image", "language_model_core", diff --git a/crates/dev_container/src/lib.rs b/crates/dev_container/src/lib.rs index 38e672ffd3e..d41e8243d5f 100644 --- a/crates/dev_container/src/lib.rs +++ b/crates/dev_container/src/lib.rs @@ -1,11 +1,11 @@ use std::path::Path; +use anyhow::anyhow; use fs::Fs; use gpui::AppContext; use gpui::Entity; use gpui::Task; use gpui::WeakEntity; -use http_client::anyhow; use picker::Picker; use picker::PickerDelegate; use project::ProjectEnvironment; @@ -1684,7 +1684,8 @@ async fn get_ghcr_features( #[cfg(test)] mod tests { - use http_client::{FakeHttpClient, anyhow}; + use anyhow::anyhow; + use http_client::FakeHttpClient; use crate::{ DevContainerTemplatesResponse, devcontainer_templates_repository, diff --git a/crates/dev_container/src/oci.rs b/crates/dev_container/src/oci.rs index 483f706edb9..a0ecd492585 100644 --- a/crates/dev_container/src/oci.rs +++ b/crates/dev_container/src/oci.rs @@ -197,9 +197,10 @@ where mod test { use std::{path::PathBuf, sync::Arc}; + use anyhow::anyhow; use fs::{FakeFs, Fs}; use gpui::TestAppContext; - use http_client::{FakeHttpClient, anyhow}; + use http_client::FakeHttpClient; use serde::Deserialize; use crate::oci::{ diff --git a/crates/http_client/src/http_client.rs b/crates/http_client/src/http_client.rs index 41d210258b3..429bcfc4218 100644 --- a/crates/http_client/src/http_client.rs +++ b/crates/http_client/src/http_client.rs @@ -1,6 +1,6 @@ mod async_body; -pub use anyhow::{Result, anyhow}; +use anyhow::Result; pub use async_body::{AsyncBody, Inner, Json}; pub use http::{self, Method, Request, Response, StatusCode, Uri, request::Builder}; use http::{HeaderName, HeaderValue}; diff --git a/crates/language_model/Cargo.toml b/crates/language_model/Cargo.toml index 49e015f4d06..18b82f47f07 100644 --- a/crates/language_model/Cargo.toml +++ b/crates/language_model/Cargo.toml @@ -25,7 +25,6 @@ env_var.workspace = true futures.workspace = true gpui.workspace = true gpui_util.workspace = true -http_client.workspace = true icons.workspace = true image.workspace = true language_model_core.workspace = true diff --git a/crates/language_model/src/fake_provider.rs b/crates/language_model/src/fake_provider.rs index b3d2137c1d3..0773be1696a 100644 --- a/crates/language_model/src/fake_provider.rs +++ b/crates/language_model/src/fake_provider.rs @@ -4,10 +4,9 @@ use crate::{ LanguageModelName, LanguageModelProvider, LanguageModelProviderId, LanguageModelProviderName, LanguageModelProviderState, LanguageModelRequest, }; -use anyhow::anyhow; +use anyhow::{Result, anyhow}; use futures::{FutureExt, channel::mpsc, future::BoxFuture, stream::StreamExt}; use gpui::{App, AsyncApp, Entity, Task}; -use http_client::Result; use parking_lot::Mutex; use std::collections::VecDeque;