From 1038a6fe9986805c62451243221a4ffb9541eb29 Mon Sep 17 00:00:00 2001 From: Heath Stewart Date: Tue, 22 Oct 2024 16:50:52 -0700 Subject: [PATCH] Remove duplicate re-export of Model macro (#1864) Also re-exports `Model` from `azure_core` along with some other types that were exported from the crate root in track 1. --- sdk/core/azure_core/src/lib.rs | 8 +++++--- .../src/federated_credentials_flow/response.rs | 3 +-- sdk/identity/azure_identity/src/refresh_token.rs | 3 +-- sdk/typespec/typespec_client_core/src/lib.rs | 3 --- 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/sdk/core/azure_core/src/lib.rs b/sdk/core/azure_core/src/lib.rs index 719021f226..df623f03f6 100644 --- a/sdk/core/azure_core/src/lib.rs +++ b/sdk/core/azure_core/src/lib.rs @@ -38,7 +38,6 @@ pub use models::*; pub use options::*; pub use pipeline::*; pub use policies::*; -pub use typespec_client_core::http::response::{Model, PinnedStream, Response, ResponseBody}; // Re-export typespec types that are not specific to Azure. pub use typespec::{Error, Result}; @@ -51,8 +50,11 @@ pub use typespec_client_core::xml; pub use typespec_client_core::{ base64, date, http::{ - headers::Header, new_http_client, AppendToUrlQuery, Body, Context, HttpClient, Method, - Pager, Request, RequestContent, StatusCode, Url, + headers::Header, + new_http_client, + response::{Model, PinnedStream, Response, ResponseBody}, + AppendToUrlQuery, Body, Context, HttpClient, Method, Pager, Request, RequestContent, + StatusCode, Url, }, json, parsing, sleep::{self, sleep}, diff --git a/sdk/identity/azure_identity/src/federated_credentials_flow/response.rs b/sdk/identity/azure_identity/src/federated_credentials_flow/response.rs index e0657d0d37..a39ed1bfaf 100644 --- a/sdk/identity/azure_identity/src/federated_credentials_flow/response.rs +++ b/sdk/identity/azure_identity/src/federated_credentials_flow/response.rs @@ -3,10 +3,9 @@ #![allow(dead_code)] -use azure_core::credentials::Secret; +use azure_core::{credentials::Secret, Model}; use serde::{Deserialize, Deserializer}; use time::OffsetDateTime; -use typespec_client_core::Model; #[derive(Debug, Clone, Deserialize)] struct RawLoginResponse { diff --git a/sdk/identity/azure_identity/src/refresh_token.rs b/sdk/identity/azure_identity/src/refresh_token.rs index 41b72f9cb2..97fce8253e 100644 --- a/sdk/identity/azure_identity/src/refresh_token.rs +++ b/sdk/identity/azure_identity/src/refresh_token.rs @@ -9,12 +9,11 @@ use azure_core::{ error::{http_response_from_body, Error, ErrorKind, ResultExt}, headers, json::from_json, - HttpClient, Method, Request, Url, + HttpClient, Method, Model, Request, Url, }; use serde::Deserialize; use std::fmt; use std::sync::Arc; -use typespec_client_core::Model; use url::form_urlencoded; /// Exchange a refresh token for a new access token and refresh token. diff --git a/sdk/typespec/typespec_client_core/src/lib.rs b/sdk/typespec/typespec_client_core/src/lib.rs index c6edf876eb..a0829664c9 100644 --- a/sdk/typespec/typespec_client_core/src/lib.rs +++ b/sdk/typespec/typespec_client_core/src/lib.rs @@ -21,6 +21,3 @@ pub mod xml; pub use crate::error::{Error, Result}; pub use bytes::Bytes; pub use uuid::Uuid; - -#[cfg(feature = "derive")] -pub use typespec_derive::Model;