Skip to content

Commit 92423c8

Browse files
committed
Fix import issues in code features
1 parent 4fe6b02 commit 92423c8

1 file changed

Lines changed: 8 additions & 12 deletions

File tree

src/convert.rs

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ impl<K: UniKindCodes> From<UniError<K>>
4444

4545
// Generic - in case the user isn't using Axum or wants to modify before returning.
4646
#[cfg(any(feature = "http_code", feature = "axum_code"))]
47-
impl<K: crate::error::UniKindCode<Code = http::StatusCode>> From<UniError<K>>
47+
impl<K: UniKindCode<Code = http::StatusCode>> From<UniError<K>>
4848
for (http::StatusCode, alloc::string::String)
4949
{
5050
fn from(err: UniError<K>) -> Self {
@@ -57,7 +57,7 @@ impl<K: crate::error::UniKindCode<Code = http::StatusCode>> From<UniError<K>>
5757

5858
// Generic - in case the user isn't using Axum or wants to modify before returning.
5959
#[cfg(any(feature = "http_code2", feature = "axum_code2"))]
60-
impl<K: crate::error::UniKindCodes<Code2 = http::StatusCode>> From<UniError<K>>
60+
impl<K: UniKindCodes<Code2 = http::StatusCode>> From<UniError<K>>
6161
for (http::StatusCode, alloc::string::String)
6262
{
6363
fn from(err: UniError<K>) -> Self {
@@ -70,7 +70,7 @@ impl<K: crate::error::UniKindCodes<Code2 = http::StatusCode>> From<UniError<K>>
7070

7171
// Generic - in case the user wants to modify before returning.
7272
#[cfg(feature = "tonic_code")]
73-
impl<K: crate::error::UniKindCode<Code = tonic::Code>> From<UniError<K>>
73+
impl<K: UniKindCode<Code = tonic::Code>> From<UniError<K>>
7474
for (tonic::Code, alloc::string::String)
7575
{
7676
fn from(err: UniError<K>) -> Self {
@@ -82,7 +82,7 @@ impl<K: crate::error::UniKindCode<Code = tonic::Code>> From<UniError<K>>
8282
}
8383

8484
#[cfg(feature = "tonic_code")]
85-
impl<K: crate::error::UniKindCode<Code = tonic::Code>> From<UniError<K>> for tonic::Status {
85+
impl<K: UniKindCode<Code = tonic::Code>> From<UniError<K>> for tonic::Status {
8686
fn from(err: UniError<K>) -> Self {
8787
tonic::Status::new(
8888
err.typed_code(),
@@ -93,7 +93,7 @@ impl<K: crate::error::UniKindCode<Code = tonic::Code>> From<UniError<K>> for ton
9393

9494
// Generic - in case the user wants to modify before returning.
9595
#[cfg(feature = "tonic_code2")]
96-
impl<K: crate::error::UniKindCodes<Code2 = tonic::Code>> From<UniError<K>>
96+
impl<K: UniKindCodes<Code2 = tonic::Code>> From<UniError<K>>
9797
for (tonic::Code, alloc::string::String)
9898
{
9999
fn from(err: UniError<K>) -> Self {
@@ -105,7 +105,7 @@ impl<K: crate::error::UniKindCodes<Code2 = tonic::Code>> From<UniError<K>>
105105
}
106106

107107
#[cfg(feature = "tonic_code2")]
108-
impl<K: crate::error::UniKindCodes<Code2 = tonic::Code>> From<UniError<K>> for tonic::Status {
108+
impl<K: UniKindCodes<Code2 = tonic::Code>> From<UniError<K>> for tonic::Status {
109109
fn from(err: UniError<K>) -> Self {
110110
tonic::Status::new(
111111
err.typed_code2(),
@@ -117,9 +117,7 @@ impl<K: crate::error::UniKindCodes<Code2 = tonic::Code>> From<UniError<K>> for t
117117
// *** IntoResponse ***
118118

119119
#[cfg(feature = "axum_code")]
120-
impl<K: crate::error::UniKindCode<Code = http::StatusCode>> axum::response::IntoResponse
121-
for UniError<K>
122-
{
120+
impl<K: UniKindCode<Code = http::StatusCode>> axum::response::IntoResponse for UniError<K> {
123121
fn into_response(self) -> axum::response::Response {
124122
(
125123
self.typed_code(),
@@ -130,9 +128,7 @@ impl<K: crate::error::UniKindCode<Code = http::StatusCode>> axum::response::Into
130128
}
131129

132130
#[cfg(feature = "axum_code2")]
133-
impl<K: crate::error::UniKindCodes<Code2 = http::StatusCode>> axum::response::IntoResponse
134-
for UniError<K>
135-
{
131+
impl<K: UniKindCodes<Code2 = http::StatusCode>> axum::response::IntoResponse for UniError<K> {
136132
fn into_response(self) -> axum::response::Response {
137133
(
138134
self.typed_code2(),

0 commit comments

Comments
 (0)