Skip to content

Commit e0b4094

Browse files
committed
optimize README.md
1 parent 6f9d8bb commit e0b4094

File tree

6 files changed

+50
-13
lines changed

6 files changed

+50
-13
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@ on:
44
push:
55
paths-ignore:
66
- '**.md'
7+
- '**.png'
78
pull_request:
89
paths-ignore:
910
- '**.md'
11+
- '**.png'
1012

1113
env:
1214
CARGO_TERM_COLOR: always

.github/workflows/coverage.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Code Coverage
2+
3+
on:
4+
push:
5+
paths-ignore:
6+
- '**.md'
7+
- '**.png'
8+
pull_request:
9+
paths-ignore:
10+
- '**.md'
11+
- '**.png'
12+
13+
env:
14+
CARGO_TERM_COLOR: always
15+
16+
jobs:
17+
coverage:
18+
name: Run cargo coverage
19+
runs-on: ubuntu-latest
20+
env:
21+
CARGO_TERM_COLOR: always
22+
steps:
23+
- name: Checkout sources
24+
uses: actions/checkout@v4
25+
- name: Install toolchain
26+
uses: actions-rs/toolchain@v1
27+
with:
28+
toolchain: 1.81.0
29+
profile: minimal
30+
override: true
31+
components: llvm-tools-preview
32+
- name: Install cargo-llvm-cov
33+
uses: taiki-e/install-action@cargo-llvm-cov
34+
- name: Generate code coverage
35+
run: sudo bash -c "ulimit -Sl 512 && ulimit -Hl 512 && sudo -u runner /home/runner/.cargo/bin/cargo llvm-cov --all-features --release --workspace --lcov --output-path lcov.info"
36+
- name: Upload coverage to Codecov
37+
run: bash <(curl -s https://codecov.io/bash) -f lcov.info -t ${{ secrets.CODECOV_TOKEN }}

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# open-coroutine
22

3+
[![crates.io](https://img.shields.io/crates/v/open-coroutine.svg)](https://crates.io/crates/open-coroutine)
4+
[![LICENSE](https://img.shields.io/github/license/acl-dev/open-coroutine.svg?style=flat-square)](https://github.com/acl-dev/open-coroutine/blob/master/LICENSE-APACHE)
5+
[![Build Status](https://github.com/acl-dev/open-coroutine/workflows/CI/badge.svg)](https://github.com/acl-dev/open-coroutine/actions)
6+
[![Codecov](https://codecov.io/github/acl-dev/open-coroutine/graph/badge.svg?token=MSM3R7CBEX)](https://codecov.io/github/acl-dev/open-coroutine)
7+
[![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/acl-dev/open-coroutine.svg)](http://isitmaintained.com/project/acl-dev/open-coroutine "Average time to resolve an issue")
8+
[![Percentage of issues still open](http://isitmaintained.com/badge/open/acl-dev/open-coroutine.svg)](http://isitmaintained.com/project/acl-dev/open-coroutine "Percentage of issues still open")
9+
310
The `open-coroutine` is a simple, efficient and generic stackful-coroutine library.
411

512
<div style="text-align: center;">

core/src/common/macros.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/// Check <https://www.rustwiki.org.cn/en/reference/introduction.html> for help information.
1+
//! Check <https://www.rustwiki.org.cn/en/reference/introduction.html> for help information.
22
33
/// Constructs an event at the trace level.
44
#[allow(unused_macros)]

core/src/common/mod.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,7 @@ pub mod work_steal;
7979
/// for i in 0..2 {
8080
/// local1.push_with_priority(i, i);
8181
/// }
82-
/// for i in 0..2 {
83-
/// assert_eq!(local1.pop(), Some(i));
84-
/// }
85-
/// for i in (2..6).rev() {
86-
/// assert_eq!(local1.pop(), Some(i));
87-
/// }
88-
/// for i in 6..8 {
82+
/// for i in 0..8 {
8983
/// assert_eq!(local1.pop(), Some(i));
9084
/// }
9185
/// assert_eq!(local0.pop(), None);

core/src/common/ordered_work_steal.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -338,10 +338,7 @@ impl<'l, T: Debug> OrderedLocalQueue<'l, T> {
338338
/// local1.push_with_priority(i, i);
339339
/// }
340340
/// assert_eq!(local1.len(), 2);
341-
/// for i in 0..2 {
342-
/// assert_eq!(local1.pop(), Some(i));
343-
/// }
344-
/// for i in (2..6).rev() {
341+
/// for i in 0..6 {
345342
/// assert_eq!(local1.pop(), Some(i));
346343
/// }
347344
/// assert_eq!(local0.pop(), None);
@@ -374,7 +371,7 @@ impl<'l, T: Debug> OrderedLocalQueue<'l, T> {
374371
//不能偷自己
375372
continue;
376373
}
377-
for entry in another.iter().rev() {
374+
for entry in another {
378375
let worker = entry.value();
379376
if worker.is_empty() {
380377
//其他队列为空

0 commit comments

Comments
 (0)