Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
http_client: Remove unused `HttpClient::type_name` method (#42803)
tidely9bebf314e001
diff --git a/crates/gpui/src/app.rs b/crates/gpui/src/app.rsindex 864968b9e7a..9d93de53d06 100644--- a/crates/gpui/src/app.rs+++ b/crates/gpui/src/app.rs@@ -2400,10 +2400,6 @@ impl HttpClient for NullHttpClient {fn proxy(&self) -> Option<&Url> {None}-- fn type_name(&self) -> &'static str {- type_name::<Self>()- }}/// A mutable reference to an entity owned by GPUIdiff --git a/crates/http_client/src/http_client.rs b/crates/http_client/src/http_client.rsindex a75df61646f..98c67f4e27a 100644--- a/crates/http_client/src/http_client.rs+++ b/crates/http_client/src/http_client.rs@@ -14,9 +14,9 @@ use futures::{};use parking_lot::Mutex;use serde::Serialize;+use std::sync::Arc;#[cfg(feature = "test-support")]-use std::fmt;-use std::{any::type_name, sync::Arc};+use std::{any::type_name, fmt};pub use url::{Host, Url};#[derive(Default, Debug, Clone, PartialEq, Eq, Hash)]@@ -59,10 +59,10 @@ impl HttpRequestExt for http::request::Builder {}pub trait HttpClient: 'static + Send + Sync {- fn type_name(&self) -> &'static str;-fn user_agent(&self) -> Option<&HeaderValue>;+ fn proxy(&self) -> Option<&Url>;+fn send(&self,req: http::Request<AsyncBody>,@@ -106,8 +106,6 @@ pub trait HttpClient: 'static + Send + Sync {}}- fn proxy(&self) -> Option<&Url>;-#[cfg(feature = "test-support")]fn as_fake(&self) -> &FakeHttpClient {panic!("called as_fake on {}", type_name::<Self>())@@ -163,10 +161,6 @@ impl HttpClient for HttpClientWithProxy {self.proxy.as_ref()}- fn type_name(&self) -> &'static str {- self.client.type_name()- }-#[cfg(feature = "test-support")]fn as_fake(&self) -> &FakeHttpClient {self.client.as_fake()@@ -182,19 +176,13 @@ impl HttpClient for HttpClientWithProxy {}/// An [`HttpClient`] that has a base URL.+#[derive(Deref)]pub struct HttpClientWithUrl {base_url: Mutex<String>,+ #[deref]client: HttpClientWithProxy,}-impl std::ops::Deref for HttpClientWithUrl {- type Target = HttpClientWithProxy;-- fn deref(&self) -> &Self::Target {- &self.client- }-}-impl HttpClientWithUrl {/// Returns a new [`HttpClientWithUrl`] with the given base URL.pub fn new(@@ -314,10 +302,6 @@ impl HttpClient for HttpClientWithUrl {self.client.proxy.as_ref()}- fn type_name(&self) -> &'static str {- self.client.type_name()- }-#[cfg(feature = "test-support")]fn as_fake(&self) -> &FakeHttpClient {self.client.as_fake()@@ -384,10 +368,6 @@ impl HttpClient for BlockedHttpClient {None}- fn type_name(&self) -> &'static str {- type_name::<Self>()- }-#[cfg(feature = "test-support")]fn as_fake(&self) -> &FakeHttpClient {panic!("called as_fake on {}", type_name::<Self>())@@ -482,10 +462,6 @@ impl HttpClient for FakeHttpClient {None}- fn type_name(&self) -> &'static str {- type_name::<Self>()- }-fn as_fake(&self) -> &FakeHttpClient {self}diff --git a/crates/reqwest_client/src/reqwest_client.rs b/crates/reqwest_client/src/reqwest_client.rsindex d0d25bdf258..c2a58877b32 100644--- a/crates/reqwest_client/src/reqwest_client.rs+++ b/crates/reqwest_client/src/reqwest_client.rs@@ -1,6 +1,6 @@use std::error::Error;use std::sync::{LazyLock, OnceLock};-use std::{any::type_name, borrow::Cow, mem, pin::Pin, task::Poll, time::Duration};+use std::{borrow::Cow, mem, pin::Pin, task::Poll, time::Duration};use anyhow::anyhow;use bytes::{BufMut, Bytes, BytesMut};@@ -215,10 +215,6 @@ impl http_client::HttpClient for ReqwestClient {self.proxy.as_ref()}- fn type_name(&self) -> &'static str {- type_name::<Self>()- }-fn user_agent(&self) -> Option<&HeaderValue> {self.user_agent.as_ref()}