Skip to content

Commit e9252ce

Browse files
authored
Merge pull request #3 from rust-lang/cleanup2
More cleanup
2 parents 6d66275 + cf1ea8e commit e9252ce

File tree

6 files changed

+14
-36
lines changed

6 files changed

+14
-36
lines changed

Cargo.lock

Lines changed: 0 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
[workspace]
22
members = [
33
"trait_transformer",
4-
"trait_transformer_test",
54
]
65

76
resolver = "2"

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,3 @@ Which creates a new `SendIntFactory: IntFactory + Send` trait and additionally b
2222

2323
Licensed under either of [Apache License, Version 2.0](LICENSE-APACHE) or
2424
[MIT license](LICENSE-MIT) at your option.
25-
26-
This is not an officially supported Google product.

trait_transformer/Cargo.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Copyright (c) 2023 Google LLC
2-
#
2+
#
33
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
44
# https://www.apache.org/licenses/LICENSE-2.0> or the MIT license
55
# <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your
@@ -21,3 +21,6 @@ proc-macro = true
2121
proc-macro2 = "1.0"
2222
quote = "1.0"
2323
syn = { version = "2.0", features = ["full"] }
24+
25+
[dev-dependencies]
26+
tokio = { version = "1", features = ["rt"] }

trait_transformer_test/src/main.rs renamed to trait_transformer/examples/trait_transformer.rs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@
66
// option. This file may not be copied, modified, or distributed
77
// except according to those terms.
88

9-
#![feature(async_fn_in_trait, return_position_impl_trait_in_trait, return_type_notation)]
9+
#![allow(incomplete_features)]
10+
#![feature(return_type_notation)]
11+
12+
use std::iter;
1013

1114
use trait_transformer::trait_transformer;
1215

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

21-
fn thing(factory: impl SendIntFactory) {
22-
tokio::task::spawn(|| async {
24+
fn thing(factory: impl SendIntFactory + 'static) {
25+
tokio::task::spawn(async move {
2326
factory.make().await;
24-
})
27+
});
2528
}
2629

2730
struct MyFactory;
2831

2932
impl IntFactory for MyFactory {
3033
async fn make(&self) -> i32 {
31-
todo!();
34+
todo!()
3235
}
3336

3437
fn stream(&self) -> impl Iterator<Item = i32> {
35-
todo!();
38+
iter::empty()
3639
}
3740

3841
fn call(&self) -> u32 {
3942
0
4043
}
4144
}
45+
impl SendIntFactory for MyFactory {}
4246

4347
fn main() {
4448
let my_factory = MyFactory;

trait_transformer_test/Cargo.toml

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)