Skip to content

Commit 581414b

Browse files
Remove nightly features #134 (#138)
* version bump * remove dep * remove async closure dep (unused) * CI fiddling
1 parent 957542e commit 581414b

File tree

6 files changed

+20
-25
lines changed

6 files changed

+20
-25
lines changed

.github/workflows/ci.yml

+10-17
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,8 @@ jobs:
2222
steps:
2323
- uses: actions/checkout@v4
2424

25-
- uses: dtolnay/rust-toolchain@master
25+
- uses: dtolnay/rust-toolchain@stable
2626
with:
27-
toolchain: ${{ env.TOOLCHAIN }}
2827
components: rustfmt
2928

3029
- name: Cargo fmt
@@ -35,9 +34,8 @@ jobs:
3534
steps:
3635
- uses: actions/checkout@v4
3736

38-
- uses: dtolnay/rust-toolchain@master
37+
- uses: dtolnay/rust-toolchain@stable
3938
with:
40-
toolchain: ${{ env.TOOLCHAIN }}
4139
components: clippy
4240

4341
- name: Cargo fmt
@@ -65,7 +63,7 @@ jobs:
6563
fail-fast: false
6664
matrix:
6765
rust-target: ["aarch64-apple-ios-sim"]
68-
apple-target-os: [ "iOS" ]
66+
apple-target-os: ["iOS"]
6967
build-std: [""]
7068
include:
7169
- rust-target: "aarch64-apple-tvos-sim"
@@ -79,9 +77,10 @@ jobs:
7977
- uses: actions/checkout@v4
8078
- uses: ./tests/support/test_server/
8179

80+
# needs nightly for now as some ios targets require -Zbuild-std
8281
- uses: dtolnay/rust-toolchain@master
8382
with:
84-
toolchain: ${{ env.TOOLCHAIN }}
83+
toolchain: "nightly"
8584
components: rust-src
8685
targets: aarch64-apple-ios-sim
8786

@@ -123,8 +122,7 @@ jobs:
123122
cargo ${{ matrix.build-std }} test --target ${{ matrix.rust-target }} -- -- --test-threads 1
124123
125124
- name: Build phoenix_channel_clients with tls
126-
run:
127-
cargo build ${{ matrix.build-std }} --target ${{ matrix.rust-target }} --features native-tls
125+
run: cargo build ${{ matrix.build-std }} --target ${{ matrix.rust-target }} --features native-tls
128126

129127
- name: Phx server logs
130128
if: ${{ failure() }}
@@ -140,9 +138,7 @@ jobs:
140138
runs-on: macos-15
141139
steps:
142140
- uses: actions/checkout@v4
143-
- uses: dtolnay/rust-toolchain@master
144-
with:
145-
toolchain: ${{ env.TOOLCHAIN }}
141+
- uses: dtolnay/rust-toolchain@stable
146142
- name: Cache Cargo
147143
uses: actions/cache@v4
148144
with:
@@ -168,9 +164,7 @@ jobs:
168164
steps:
169165
- uses: actions/checkout@v4
170166
- uses: ./tests/support/test_server/
171-
- uses: dtolnay/rust-toolchain@master
172-
with:
173-
toolchain: ${{ env.TOOLCHAIN }}
167+
- uses: dtolnay/rust-toolchain@stable
174168

175169
- name: Cache Cargo
176170
uses: actions/cache@v4
@@ -207,9 +201,8 @@ jobs:
207201
- uses: actions/checkout@v4
208202
- uses: ./tests/support/test_server/
209203
- name: Install Rust Nightly
210-
uses: dtolnay/rust-toolchain@master
204+
uses: dtolnay/rust-toolchain@stable
211205
with:
212-
toolchain: ${{ env.TOOLCHAIN }}
213206
target: x86_64-linux-android
214207

215208
- name: Cache Cargo
@@ -229,7 +222,7 @@ jobs:
229222
uses: actions/setup-java@v4
230223
with:
231224
java-version: 17
232-
distribution: 'temurin'
225+
distribution: "temurin"
233226

234227
- name: Enable KVM
235228
run: |

Cargo.lock

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "phoenix_channels_client"
3-
version = "0.9.0"
3+
version = "0.9.1"
44
rust-version = "1.64"
55
authors = ["Paul Schoenfelder <paulschoenfelder@gmail.com>", "Elle Imhoff <Kronic.Deth@gmail.com>"]
66
description = "Provides an async-ready client for Phoenix Channels in Rust"

src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#![doc = include_str!("../README.md")]
22
#![cfg_attr(feature = "nightly", feature(slice_take))]
3-
#![feature(hash_extract_if)]
43
// doc warnings that aren't on by default
54
#![warn(missing_docs)]
65
#![warn(rustdoc::unescaped_backticks)]

src/rust/presences/listener.rs

+8-4
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,14 @@ impl PresenceByKey {
139139
join_tx: &broadcast::Sender<Arc<Join>>,
140140
leave_tx: &broadcast::Sender<Arc<Leave>>,
141141
) {
142-
let mut left_presence_by_key: HashMap<String, Presence> = self
143-
.0
144-
.extract_if(|key, _presence| !new.0.contains_key(key))
145-
.collect();
142+
let temp_self = std::mem::take(&mut self.0);
143+
144+
let (mut left_presence_by_key, new_self): (HashMap<_, _>, _) = temp_self
145+
.into_iter()
146+
.partition(|(key, _)| !new.0.contains_key(key));
147+
148+
self.0 = new_self;
149+
146150
let mut joined_presence_by_key: HashMap<String, Presence> = Default::default();
147151

148152
for (new_key, mut new_presence) in new.0 {

tests/integration_test.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#![cfg_attr(feature = "nightly", feature(assert_matches))]
2-
#![feature(async_closure)]
32

43
#[cfg(feature = "nightly")]
54
use std::assert_matches::assert_matches;

0 commit comments

Comments
 (0)