Rename ZedHttpClient for clarity (#8320)

This PR renames the `ZedHttpClient` to `HttpClientWithUrl` to make it
slightly clearer that it still is holding a `dyn HttpClient` as opposed
to being a concrete implementation.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2024-02-24 00:07:24 -05:00 committed by GitHub
parent 58463b2e97
commit ba4e1699ae
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 77 additions and 70 deletions

View file

@ -20,7 +20,7 @@ use telemetry_events::{
EditEvent, EditorEvent, Event, EventRequestBody, EventWrapper, MemoryEvent, SettingEvent,
};
use tempfile::NamedTempFile;
use util::http::{self, HttpClient, Method, ZedHttpClient};
use util::http::{self, HttpClient, HttpClientWithUrl, Method};
#[cfg(not(debug_assertions))]
use util::ResultExt;
use util::TryFutureExt;
@ -29,7 +29,7 @@ use self::event_coalescer::EventCoalescer;
pub struct Telemetry {
clock: Arc<dyn SystemClock>,
http_client: Arc<ZedHttpClient>,
http_client: Arc<HttpClientWithUrl>,
executor: BackgroundExecutor,
state: Arc<Mutex<TelemetryState>>,
}
@ -75,7 +75,7 @@ static ZED_CLIENT_CHECKSUM_SEED: Lazy<Option<Vec<u8>>> = Lazy::new(|| {
impl Telemetry {
pub fn new(
clock: Arc<dyn SystemClock>,
client: Arc<ZedHttpClient>,
client: Arc<HttpClientWithUrl>,
cx: &mut AppContext,
) -> Arc<Self> {
let release_channel =
@ -474,7 +474,7 @@ impl Telemetry {
let request = http::Request::builder()
.method(Method::POST)
.uri(this.http_client.zed_api_url("/telemetry/events"))
.uri(this.http_client.build_zed_api_url("/telemetry/events"))
.header("Content-Type", "text/plain")
.header("x-zed-checksum", checksum)
.body(json_bytes.into());