Skip to content

Commit

Permalink
Add ToTokens to derive::prelude
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki-e committed Jan 15, 2025
1 parent 15a426a commit 262bd04
Show file tree
Hide file tree
Showing 9 changed files with 1 addition and 44 deletions.
2 changes: 0 additions & 2 deletions src/derive/core/future.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT

use quote::ToTokens as _;

use crate::derive::prelude::*;

pub(crate) const NAME: &[&str] = &["Future"];
Expand Down
2 changes: 0 additions & 2 deletions src/derive/core/ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,6 @@ pub(crate) mod range_bounds {

#[cfg(feature = "coroutine_trait")]
pub(crate) mod coroutine {
use quote::ToTokens as _;

use crate::derive::prelude::*;

pub(crate) const NAME: &[&str] = &["Coroutine"];
Expand Down
12 changes: 0 additions & 12 deletions src/derive/external/futures03.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT

pub(crate) mod async_buf_read {
use quote::ToTokens as _;

use crate::derive::prelude::*;

pub(crate) const NAME: &[&str] = &["futures03::AsyncBufRead"];
Expand Down Expand Up @@ -54,8 +52,6 @@ pub(crate) mod async_buf_read {
}

pub(crate) mod async_read {
use quote::ToTokens as _;

use crate::derive::prelude::*;

pub(crate) const NAME: &[&str] = &["futures03::AsyncRead"];
Expand Down Expand Up @@ -113,8 +109,6 @@ pub(crate) mod async_read {
}

pub(crate) mod async_seek {
use quote::ToTokens as _;

use crate::derive::prelude::*;

pub(crate) const NAME: &[&str] = &["futures03::AsyncSeek"];
Expand Down Expand Up @@ -153,8 +147,6 @@ pub(crate) mod async_seek {
}

pub(crate) mod async_write {
use quote::ToTokens as _;

use crate::derive::prelude::*;

pub(crate) const NAME: &[&str] = &["futures03::AsyncWrite"];
Expand Down Expand Up @@ -246,8 +238,6 @@ pub(crate) mod async_write {
}

pub(crate) mod sink {
use quote::ToTokens as _;

use crate::derive::prelude::*;

pub(crate) const NAME: &[&str] = &["futures03::Sink"];
Expand Down Expand Up @@ -338,8 +328,6 @@ pub(crate) mod sink {
}

pub(crate) mod stream {
use quote::ToTokens as _;

use crate::derive::prelude::*;

pub(crate) const NAME: &[&str] = &["futures03::Stream"];
Expand Down
2 changes: 0 additions & 2 deletions src/derive/external/http_body1.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT

pub(crate) mod body {
use quote::ToTokens as _;

use crate::derive::prelude::*;

pub(crate) const NAME: &[&str] = &["http_body1::Body"];
Expand Down
8 changes: 0 additions & 8 deletions src/derive/external/tokio02.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT

pub(crate) mod async_buf_read {
use quote::ToTokens as _;

use crate::derive::prelude::*;

pub(crate) const NAME: &[&str] = &["tokio02::AsyncBufRead"];
Expand Down Expand Up @@ -52,8 +50,6 @@ pub(crate) mod async_buf_read {
}

pub(crate) mod async_read {
use quote::ToTokens as _;

use crate::derive::prelude::*;

pub(crate) const NAME: &[&str] = &["tokio02::AsyncRead"];
Expand Down Expand Up @@ -105,8 +101,6 @@ pub(crate) mod async_read {
}

pub(crate) mod async_seek {
use quote::ToTokens as _;

use crate::derive::prelude::*;

pub(crate) const NAME: &[&str] = &["tokio02::AsyncSeek"];
Expand Down Expand Up @@ -160,8 +154,6 @@ pub(crate) mod async_seek {
}

pub(crate) mod async_write {
use quote::ToTokens as _;

use crate::derive::prelude::*;

pub(crate) const NAME: &[&str] = &["tokio02::AsyncWrite"];
Expand Down
8 changes: 0 additions & 8 deletions src/derive/external/tokio03.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT

pub(crate) mod async_buf_read {
use quote::ToTokens as _;

use crate::derive::prelude::*;

pub(crate) const NAME: &[&str] = &["tokio03::AsyncBufRead"];
Expand Down Expand Up @@ -52,8 +50,6 @@ pub(crate) mod async_buf_read {
}

pub(crate) mod async_read {
use quote::ToTokens as _;

use crate::derive::prelude::*;

pub(crate) const NAME: &[&str] = &["tokio03::AsyncRead"];
Expand Down Expand Up @@ -91,8 +87,6 @@ pub(crate) mod async_read {
}

pub(crate) mod async_seek {
use quote::ToTokens as _;

use crate::derive::prelude::*;

pub(crate) const NAME: &[&str] = &["tokio03::AsyncSeek"];
Expand Down Expand Up @@ -145,8 +139,6 @@ pub(crate) mod async_seek {
}

pub(crate) mod async_write {
use quote::ToTokens as _;

use crate::derive::prelude::*;

pub(crate) const NAME: &[&str] = &["tokio03::AsyncWrite"];
Expand Down
8 changes: 0 additions & 8 deletions src/derive/external/tokio1.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT

pub(crate) mod async_buf_read {
use quote::ToTokens as _;

use crate::derive::prelude::*;

pub(crate) const NAME: &[&str] = &["tokio1::AsyncBufRead"];
Expand Down Expand Up @@ -52,8 +50,6 @@ pub(crate) mod async_buf_read {
}

pub(crate) mod async_read {
use quote::ToTokens as _;

use crate::derive::prelude::*;

pub(crate) const NAME: &[&str] = &["tokio1::AsyncRead"];
Expand Down Expand Up @@ -91,8 +87,6 @@ pub(crate) mod async_read {
}

pub(crate) mod async_seek {
use quote::ToTokens as _;

use crate::derive::prelude::*;

pub(crate) const NAME: &[&str] = &["tokio1::AsyncSeek"];
Expand Down Expand Up @@ -145,8 +139,6 @@ pub(crate) mod async_seek {
}

pub(crate) mod async_write {
use quote::ToTokens as _;

use crate::derive::prelude::*;

pub(crate) const NAME: &[&str] = &["tokio1::AsyncWrite"];
Expand Down
2 changes: 1 addition & 1 deletion src/derive/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pub(crate) mod ty_impls;
mod prelude {
pub(super) use derive_utils::{derive_trait, EnumData as Data, EnumImpl};
pub(super) use proc_macro2::TokenStream;
pub(super) use quote::{format_ident, quote};
pub(super) use quote::{format_ident, quote, ToTokens as _};
pub(super) use syn::{parse_quote, Result};

pub(super) use crate::enum_derive::DeriveContext as Context;
Expand Down
1 change: 0 additions & 1 deletion src/derive/ty_impls/transpose.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT

use quote::ToTokens as _;
use syn::TypeParam;

use crate::derive::prelude::*;
Expand Down

0 comments on commit 262bd04

Please sign in to comment.