From e3041d12f59b561b40d8c4642483ece81f43723a Mon Sep 17 00:00:00 2001 From: Rajiv Shah Date: Thu, 10 Jun 2021 11:39:27 -0400 Subject: [PATCH 1/5] Fix build on nightly (#7) Thanks will release ASAP. --- src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index e377a38..8441fe7 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,5 +1,5 @@ -#![ cfg_attr( nightly, feature( external_doc, doc_cfg ) ) ] -#![ cfg_attr( nightly, doc ( include = "../README.md" ) ) ] +#![ 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 ( html_root_url = "https://docs.rs/pharos" ) ] From 1eb4959becb1da65a7e61d03ceabdafceae6c510 Mon Sep 17 00:00:00 2001 From: Naja Melan Date: Thu, 10 Jun 2021 17:44:26 +0200 Subject: [PATCH 2/5] Remove travis config. --- .github/workflows/ci.yml | 5 --- .travis.yml | 68 ---------------------------------------- 2 files changed, 73 deletions(-) delete mode 100644 .travis.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8413821..d4a2c07 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,11 +17,6 @@ jobs: override: true components: clippy - - name: Install nightly - uses: actions-rs/toolchain@v1 - with: - toolchain: nightly - - name: Checkout crate uses: actions/checkout@v2 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 3972537..0000000 --- a/.travis.yml +++ /dev/null @@ -1,68 +0,0 @@ -language: rust - -# Need to cache the whole `.cargo` directory to keep .crates.toml for -# cargo-update to work -# -cache: - directories: - - /home/travis/.cargo - -# But don't cache the cargo registry -# and remove wasm-pack binary to avoid the installer asking confirmation for overwriting it. -# -before_cache: - - rm -rf /home/travis/.cargo/git - - rm -rf /home/travis/.cargo/registry - - rm -rf /home/travis/.cargo/bin/cargo-tarpaulin - - rm -rf target/debug/incremental/{pharos,build_script_build}-* - - rm -rf target/debug/.fingerprint/pharos-* - - rm -rf target/debug/build/pharos-* - - rm -rf target/debug/deps/libpharos-* - - rm -rf target/debug/deps/pharos-* - - rm -rf target/debug/{pharos,libpharos}.d - - cargo clean -p pharos - - -branches: - only: - - master - - dev - -jobs: - - include: - - - name : linux stable check - os : linux - rust : stable - script: cargo check - - - - name : linux nightly test everything - os : linux - dist : bionic - rust : nightly - - addons: - firefox: latest - apt: - packages: - - libssl-dev # for cargo-tarpaulin - - script: - - bash ci/check.bash - - bash ci/test.bash - - bash ci/doc.bash - - bash ci/coverage.bash - - - - os : osx - script: - - bash ci/test.bash - - - - os : windows - script: - - bash ci/test.bash - - From 025299364a9ec61faf05d00d04bcf7a7f3043c59 Mon Sep 17 00:00:00 2001 From: Naja Melan Date: Thu, 10 Jun 2021 17:53:56 +0200 Subject: [PATCH 3/5] Silence a clippy warning. --- src/pharos.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/pharos.rs b/src/pharos.rs index 2dfae7d..66b5fb5 100644 --- a/src/pharos.rs +++ b/src/pharos.rs @@ -190,7 +190,12 @@ impl Sink for Pharos where Event: Clone + 'static + Send } - // As soon as any is not ready, we are not ready + // As soon as any is not ready, we are not ready. + // + // This is a false warning AFAICT. We need to set obs + // to None at the end, which is not possible if we have flattened the iterator. + // + #[allow(clippy::manual_flatten)] // for obs in self.get_mut().observers.iter_mut() { From 50251fd8da731853116225b8bab25c315d56dcb3 Mon Sep 17 00:00:00 2001 From: Naja Melan Date: Thu, 10 Jun 2021 17:54:53 +0200 Subject: [PATCH 4/5] Silence warning about name ambiguity. --- src/pharos.rs | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/pharos.rs b/src/pharos.rs index 66b5fb5..eecd659 100644 --- a/src/pharos.rs +++ b/src/pharos.rs @@ -364,6 +364,8 @@ mod tests // - ✔ start_send filter message // - ✔ poll_flush drop on error // + // TODO: fix the assert_matches ambiguity. Can we use assert!( matches!() ) from std? + // use crate :: { *, import::* }; #[test] @@ -523,14 +525,14 @@ mod tests { let mut ph = Pin::new( &mut ph ); - assert_matches!( ph.as_mut().poll_ready( &mut cx ), Poll::Ready( Ok(_) ) ); + crate::assert_matches!( ph.as_mut().poll_ready( &mut cx ), Poll::Ready( Ok(_) ) ); assert!( ph.as_mut().start_send( true ).is_ok() ); - assert_matches!( ph.as_mut().poll_ready( &mut cx ), Poll::Pending ); + crate::assert_matches!( ph.as_mut().poll_ready( &mut cx ), Poll::Pending ); assert_eq!( Pin::new( &mut full ).poll_next(cx), Poll::Ready(Some(true))); - assert_matches!( ph.as_mut().poll_ready( &mut cx ), Poll::Ready( Ok(_) ) ); + crate::assert_matches!( ph.as_mut().poll_ready( &mut cx ), Poll::Ready( Ok(_) ) ); ().into() @@ -558,7 +560,7 @@ mod tests poll_fn( move |mut cx| { - assert_matches!( ph.as_mut().poll_ready( &mut cx ), Poll::Ready( Ok(_) ) ); + crate::assert_matches!( ph.as_mut().poll_ready( &mut cx ), Poll::Ready( Ok(_) ) ); assert!( ph.observers[1].is_none() ); @@ -581,11 +583,11 @@ mod tests let mut ph = Pin::new( &mut ph ); - assert_matches!( ph.as_mut().poll_close( cx ), Poll::Ready(Ok(())) ); + crate::assert_matches!( ph.as_mut().poll_close( cx ), Poll::Ready(Ok(())) ); let res = ph.as_mut().poll_ready( &mut cx ); - assert_matches!( res, Poll::Ready( Err(_) ) ); + crate::assert_matches!( res, Poll::Ready( Err(_) ) ); match res { @@ -616,7 +618,7 @@ mod tests { let mut ph = Pin::new( &mut ph ); - assert_matches!( ph.as_mut().poll_ready( &mut cx ), Poll::Ready( Ok(_) ) ); + crate::assert_matches!( ph.as_mut().poll_ready( &mut 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))); @@ -646,7 +648,7 @@ mod tests poll_fn( move |mut cx| { - assert_matches!( ph.as_mut().poll_flush( &mut cx ), Poll::Ready( Ok(_) ) ); + crate::assert_matches!( ph.as_mut().poll_flush( &mut cx ), Poll::Ready( Ok(_) ) ); assert!( ph.observers[1].is_none() ); ().into() From 78e793f2ec856643bcfd4f094a50fc7a30465422 Mon Sep 17 00:00:00 2001 From: Naja Melan Date: Thu, 10 Jun 2021 18:00:08 +0200 Subject: [PATCH 5/5] Update dependencies, changelog and version number. --- CHANGELOG.md | 13 +++++++++++-- Cargo.toml | 4 ++-- Cargo.yml | 4 ++-- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c784c90..113be10 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,19 @@ # Pharos Changelog -## 0.5.1 - 2020-02-18 +## [0.5.2] - 2021-06-10 + +[0.5.2]: https://github.com/najamelan/async_executors/compare/0.5.1...0.5.2 + +### Fixed + + - Remove external_doc for rustdoc 1.54. Thanks to @rajivshah3 + + +## 0.5.1 - 2021-02-18 - Add `ObservableLocal` for observable types that are `!Send`. -## 0.5.0 - 2020-02-17 +## 0.5.0 - 2021-02-17 - **BREAKING CHANGE**: `Observable::observe` is now an async function. This was needed to make it possible to send events to a pharos object from different async tasks. So far notifying was async, but observing was not. However diff --git a/Cargo.toml b/Cargo.toml index a5f86ff..47f9dd4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,7 +7,7 @@ status = "actively-developed" repository = "najamelan/pharos" [build-dependencies] -rustc_version = "^0.2" +rustc_version = "^0.4" [dependencies] [dependencies.futures] @@ -39,7 +39,7 @@ license = "Unlicense" name = "pharos" readme = "README.md" repository = "https://github.com/najamelan/pharos" -version = "0.5.1" +version = "0.5.2" [package.metadata] [package.metadata.docs] diff --git a/Cargo.yml b/Cargo.yml index 92c6a32..acbdeae 100644 --- a/Cargo.yml +++ b/Cargo.yml @@ -24,7 +24,7 @@ package: # - `git tag x.x.x` with version number. # - `git push && git push --tags` # - version : 0.5.1 + version : 0.5.2 name : pharos authors : [ Naja Melan ] edition : '2018' @@ -65,7 +65,7 @@ dev-dependencies: build-dependencies: - rustc_version: ^0.2 + rustc_version: ^0.4 profile: