Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More cleanup #3

Merged
merged 3 commits into from
Dec 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[workspace]
members = [
"trait_transformer",
"trait_transformer_test",
]

resolver = "2"
Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,3 @@ Which creates a new `SendIntFactory: IntFactory + Send` trait and additionally b

Licensed under either of [Apache License, Version 2.0](LICENSE-APACHE) or
[MIT license](LICENSE-MIT) at your option.

This is not an officially supported Google product.
5 changes: 4 additions & 1 deletion trait_transformer/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) 2023 Google LLC
#
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# https://www.apache.org/licenses/LICENSE-2.0> or the MIT license
# <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your
Expand All @@ -21,3 +21,6 @@ proc-macro = true
proc-macro2 = "1.0"
quote = "1.0"
syn = { version = "2.0", features = ["full"] }

[dev-dependencies]
tokio = { version = "1", features = ["rt"] }
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#![feature(async_fn_in_trait, return_position_impl_trait_in_trait, return_type_notation)]
#![allow(incomplete_features)]
#![feature(return_type_notation)]

use std::iter;

use trait_transformer::trait_transformer;

Expand All @@ -18,27 +21,28 @@ trait IntFactory {
fn call(&self) -> u32;
}

fn thing(factory: impl SendIntFactory) {
tokio::task::spawn(|| async {
fn thing(factory: impl SendIntFactory + 'static) {
tokio::task::spawn(async move {
factory.make().await;
})
});
}

struct MyFactory;

impl IntFactory for MyFactory {
async fn make(&self) -> i32 {
todo!();
todo!()
}

fn stream(&self) -> impl Iterator<Item = i32> {
todo!();
iter::empty()
}

fn call(&self) -> u32 {
0
}
}
impl SendIntFactory for MyFactory {}

fn main() {
let my_factory = MyFactory;
Expand Down
19 changes: 0 additions & 19 deletions trait_transformer_test/Cargo.toml

This file was deleted.