File tree 6 files changed +12
-9
lines changed
6 files changed +12
-9
lines changed Original file line number Diff line number Diff line change 22
22
run : cargo clippy --all-targets --all-features
23
23
- name : Run tests
24
24
run : cargo test
25
+ - name : Run examples
26
+ run : |
27
+ for example in $(ls examples/ | sed 's/\.rs$//'); do
28
+ cargo run --example $example
29
+ done
25
30
26
31
semver :
27
32
runs-on : ubuntu-latest
Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ async fn main() {
53
53
tokio:: spawn ( root. instrument ( work ( rx) ) ) ;
54
54
55
55
sleep ( Duration :: from_millis ( 100 ) ) . await ;
56
- let tree = registry. get ( & ( ) ) . unwrap ( ) . to_string ( ) ;
56
+ let tree = registry. get ( ( ) ) . unwrap ( ) . to_string ( ) ;
57
57
58
58
// work [106.290ms]
59
59
// select [106.093ms]
@@ -62,7 +62,7 @@ async fn main() {
62
62
println ! ( "{tree}" ) ;
63
63
64
64
sleep ( Duration :: from_secs ( 1 ) ) . await ;
65
- let tree = registry. get ( & ( ) ) . unwrap ( ) . to_string ( ) ;
65
+ let tree = registry. get ( ( ) ) . unwrap ( ) . to_string ( ) ;
66
66
67
67
// work [1.112s]
68
68
// rx [606.944ms]
@@ -72,7 +72,7 @@ async fn main() {
72
72
73
73
tx. send ( ( ) ) . unwrap ( ) ;
74
74
sleep ( Duration :: from_secs ( 1 ) ) . await ;
75
- let tree = registry. get ( & ( ) ) . unwrap ( ) . to_string ( ) ;
75
+ let tree = registry. get ( ( ) ) . unwrap ( ) . to_string ( ) ;
76
76
77
77
// work [2.117s]
78
78
// fut [2.117s]
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ async fn work(verbose: bool) -> String {
32
32
tokio:: spawn ( root. instrument ( foo ( ) ) ) ;
33
33
34
34
sleep ( Duration :: from_secs ( 1 ) ) . await ;
35
- registry. get ( & ( ) ) . unwrap ( ) . to_string ( )
35
+ registry. get ( ( ) ) . unwrap ( ) . to_string ( )
36
36
}
37
37
38
38
#[ tokio:: main]
Original file line number Diff line number Diff line change 1
- 1.74
1
+ 1.82
Original file line number Diff line number Diff line change @@ -186,8 +186,8 @@ impl Registry {
186
186
///
187
187
/// 1. If the current task is registered with a registry, returns the registry.
188
188
/// 2. If the global registry is initialized with
189
- /// [`init_global_registry`](crate::global::init_global_registry), returns the global
190
- /// registry.
189
+ /// [`init_global_registry`](crate::global::init_global_registry), returns the global
190
+ /// registry.
191
191
/// 3. Otherwise, returns `None`.
192
192
pub fn try_current ( ) -> Option < Self > {
193
193
crate :: root:: current_registry ( )
Original file line number Diff line number Diff line change 12
12
// See the License for the specific language governing permissions and
13
13
// limitations under the License.
14
14
15
- #![ cfg( test) ]
16
-
17
15
mod functionality;
18
16
mod spawn;
You can’t perform that action at this time.
0 commit comments