Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
* dev:
  Update changelog.
  Install tarpaulin in CI.
  Fix clippy warnings.
  No nightly in test.bash after all.
  Add funding.
  Update to edition 2021.
  Fix CI.
  We need feature std on futures for channel.
  Fix errors in changelog.
  • Loading branch information
najamelan committed Oct 31, 2021
2 parents dadacd2 + dc31d46 commit cc24b17
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 37 deletions.
1 change: 1 addition & 0 deletions .github/funding.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
liberapay: najamelan
15 changes: 13 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,19 @@ jobs:
run : bash ci/test.bash


- name: Check coverage
run: bash ci/coverage.bash
- name: Install cargo-tarpaulin binary crate
uses: actions-rs/[email protected]
with:
crate: cargo-tarpaulin
version: latest
use-tool-cache: true

- name: Run cargo-tarpaulin
run : |
cargo tarpaulin --out Xml
- name: Upload to codecov.io
uses: codecov/[email protected]


- name: install wasm-pack
Expand Down
18 changes: 17 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,24 @@
# Pharos Changelog

## [Unreleased]

[Unreleased]: https://github.com/najamelan/pharos/compare/0.5.3...dev


## [Unreleased]

[0.5.3]: https://github.com/najamelan/pharos/compare/0.5.2...0.5.3

### Fixed

- require std feature on futures for channel dependency
- improve CI.
- update to edition 2021
- clean up some rustdoc features

## [0.5.2] - 2021-06-10

[0.5.2]: https://github.com/najamelan/async_executors/compare/0.5.1...0.5.2
[0.5.2]: https://github.com/najamelan/pharos/compare/0.5.1...0.5.2

### Fixed

Expand Down
5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ rustc_version = "^0.4"
[dependencies]
[dependencies.futures]
default-features = false
features = ["std"]
version = "^0.3"

[dev-dependencies]
Expand All @@ -32,14 +33,14 @@ authors = ["Naja Melan <[email protected]>"]
categories = ["asynchronous"]
description = "Observer pattern which generates a futures 0.3 stream of events"
documentation = "https://docs.rs/pharos"
edition = "2018"
edition = "2021"
exclude = ["tests", "examples", "ci", ".travis.yml", "TODO.md", "CONTRIBUTING.md"]
keywords = ["observer", "futures", "stream", "broadcast", "publish_subscribe"]
license = "Unlicense"
name = "pharos"
readme = "README.md"
repository = "https://github.com/najamelan/pharos"
version = "0.5.2"
version = "0.5.3"

[package.metadata]
[package.metadata.docs]
Expand Down
10 changes: 5 additions & 5 deletions Cargo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ package:
# - `git tag x.x.x` with version number.
# - `git push && git push --tags`
#
version : 0.5.2
version : 0.5.3
name : pharos
authors : [ Naja Melan <[email protected]> ]
edition : '2018'
edition : '2021'
readme : README.md
license : Unlicense
repository : https://github.com/najamelan/pharos
Expand All @@ -52,15 +52,15 @@ badges:

dependencies:

futures: { version: ^0.3, default-features: false }
futures: { version: ^0.3, default-features: false, features: [std] }


dev-dependencies:

futures : ^0.3
assert_matches : ^1
async-std : { version: ^1 , features: [attributes] }
async_executors : { version: ^0.4, features: [ async_std ] }
async-std : { version: ^1 , features: [ attributes ] }
async_executors : { version: ^0.4, features: [ async_std ] }
wasm-bindgen-test : ^0.3

build-dependencies:
Expand Down
13 changes: 0 additions & 13 deletions ci/coverage.bash

This file was deleted.

3 changes: 1 addition & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#![ cfg_attr( nightly, feature( doc_cfg ) ) ]
#![ cfg_attr( nightly, cfg_attr( nightly, doc = include_str!("../README.md") ) )]
#![ doc = "" ] // empty doc line to handle missing doc warning when the feature is missing.
#![ doc = include_str!( "../README.md" ) ]

#![ doc ( html_root_url = "https://docs.rs/pharos" ) ]
#![ deny ( missing_docs ) ]
Expand Down
24 changes: 12 additions & 12 deletions src/pharos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -521,18 +521,18 @@ mod tests
let mut full = ph.observe( Channel::Bounded ( 1 ).into() ).await.expect( "observe" );
let _unbound = ph.observe( Channel::Unbounded .into() ).await.expect( "observe" );

poll_fn( move |mut cx|
poll_fn( move |cx|
{
let mut ph = Pin::new( &mut ph );

crate::assert_matches!( ph.as_mut().poll_ready( &mut cx ), Poll::Ready( Ok(_) ) );
crate::assert_matches!( ph.as_mut().poll_ready( cx ), Poll::Ready( Ok(_) ) );
assert!( ph.as_mut().start_send( true ).is_ok() );

crate::assert_matches!( ph.as_mut().poll_ready( &mut cx ), Poll::Pending );
crate::assert_matches!( ph.as_mut().poll_ready( cx ), Poll::Pending );

assert_eq!( Pin::new( &mut full ).poll_next(cx), Poll::Ready(Some(true)));

crate::assert_matches!( ph.as_mut().poll_ready( &mut cx ), Poll::Ready( Ok(_) ) );
crate::assert_matches!( ph.as_mut().poll_ready( cx ), Poll::Ready( Ok(_) ) );

().into()

Expand All @@ -558,9 +558,9 @@ mod tests
drop( full );


poll_fn( move |mut cx|
poll_fn( move |cx|
{
crate::assert_matches!( ph.as_mut().poll_ready( &mut cx ), Poll::Ready( Ok(_) ) );
crate::assert_matches!( ph.as_mut().poll_ready( cx ), Poll::Ready( Ok(_) ) );

assert!( ph.observers[1].is_none() );

Expand All @@ -577,15 +577,15 @@ mod tests
//
fn poll_ready_closed()
{
block_on( poll_fn( move |mut cx|
block_on( poll_fn( move |cx|
{
let mut ph = Pharos::<bool>::default();

let mut ph = Pin::new( &mut ph );

crate::assert_matches!( ph.as_mut().poll_close( cx ), Poll::Ready(Ok(())) );

let res = ph.as_mut().poll_ready( &mut cx );
let res = ph.as_mut().poll_ready( cx );

crate::assert_matches!( res, Poll::Ready( Err(_) ) );

Expand Down Expand Up @@ -614,11 +614,11 @@ mod tests
let mut full = ph.observe( Channel::Bounded ( 1 ).into() ).await.expect( "observe" );
let _unbound = ph.observe( Channel::Unbounded .into() ).await.expect( "observe" );

poll_fn( move |mut cx|
poll_fn( move |cx|
{
let mut ph = Pin::new( &mut ph );

crate::assert_matches!( ph.as_mut().poll_ready( &mut cx ), Poll::Ready( Ok(_) ) );
crate::assert_matches!( ph.as_mut().poll_ready( cx ), Poll::Ready( Ok(_) ) );
assert!( ph.as_mut().start_send( 3 ).is_ok() );

assert_eq!( Pin::new( &mut full ).poll_next(cx), Poll::Ready(Some(3)));
Expand Down Expand Up @@ -646,9 +646,9 @@ mod tests

drop( full );

poll_fn( move |mut cx|
poll_fn( move |cx|
{
crate::assert_matches!( ph.as_mut().poll_flush( &mut cx ), Poll::Ready( Ok(_) ) );
crate::assert_matches!( ph.as_mut().poll_flush( cx ), Poll::Ready( Ok(_) ) );

assert!( ph.observers[1].is_none() );
().into()
Expand Down

0 comments on commit cc24b17

Please sign in to comment.