Skip to content

Commit ae68c99

Browse files
MOD-10709 Pin nightly Rust toolchain and update CI (#418)
* Pin nightly Rust toolchain and update CI - Add rust-toolchain.toml pinning to nightly-2025-07-30 - Update CI to test both stable and pinned nightly versions - CI dynamically reads nightly version from toolchain file * Fix build errors
1 parent b5b359e commit ae68c99

6 files changed

Lines changed: 25 additions & 8 deletions

File tree

.github/workflows/ci.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,23 @@ name: CI
33
on: [pull_request]
44

55
jobs:
6+
get-nightly-version:
7+
runs-on: ubuntu-latest
8+
outputs:
9+
nightly-version: ${{ steps.get-nightly.outputs.version }}
10+
steps:
11+
- name: Checkout sources
12+
uses: actions/checkout@v4
13+
- name: Get nightly version from rust-toolchain.toml
14+
id: get-nightly
15+
run: |
16+
NIGHTLY_VERSION=$(grep 'channel = ' rust-toolchain.toml | sed 's/.*"\(.*\)".*/\1/')
17+
echo "version=$NIGHTLY_VERSION" >> $GITHUB_OUTPUT
18+
619
test:
720
name: Build and run the unit tests using the latest rust.
821
runs-on: ${{ matrix.os }}
22+
needs: get-nightly-version
923
strategy:
1024
fail-fast: false
1125
matrix:
@@ -18,8 +32,8 @@ jobs:
1832
- [7-0, "7.2"]
1933
- [7-2, "7.2"]
2034
toolchain:
21-
- 1.81.0
2235
- stable
36+
- ${{ needs.get-nightly-version.outputs.nightly-version }}
2337

2438
steps:
2539
- name: Checkout sources

rust-toolchain.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[toolchain]
2+
channel = "nightly-2025-07-30"
3+
components = ["rustfmt", "clippy"]

src/context/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1352,7 +1352,7 @@ impl<'a> InfoContextBuilder<'a> {
13521352
}
13531353

13541354
/// Returns a section builder.
1355-
pub fn add_section(self, name: &'a str) -> InfoContextBuilderSectionBuilder {
1355+
pub fn add_section(self, name: &'a str) -> InfoContextBuilderSectionBuilder<'a> {
13561356
InfoContextBuilderSectionBuilder {
13571357
info_builder: self,
13581358
name: name.to_owned(),

src/key.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ impl RedisKey {
169169
Ok(val)
170170
}
171171

172-
pub fn get_stream_iterator(&self, reverse: bool) -> Result<StreamIterator, RedisError> {
172+
pub fn get_stream_iterator(&self, reverse: bool) -> Result<StreamIterator<'_>, RedisError> {
173173
StreamIterator::new(self, None, None, false, reverse)
174174
}
175175

@@ -179,7 +179,7 @@ impl RedisKey {
179179
to: Option<raw::RedisModuleStreamID>,
180180
exclusive: bool,
181181
reverse: bool,
182-
) -> Result<StreamIterator, RedisError> {
182+
) -> Result<StreamIterator<'_>, RedisError> {
183183
StreamIterator::new(self, from, to, exclusive, reverse)
184184
}
185185
}
@@ -245,7 +245,7 @@ impl RedisKeyWritable {
245245
self.key_type() == KeyType::Empty
246246
}
247247

248-
pub fn as_string_dma(&self) -> Result<StringDMA, RedisError> {
248+
pub fn as_string_dma(&self) -> Result<StringDMA<'_>, RedisError> {
249249
StringDMA::new(self)
250250
}
251251

src/raw.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ pub fn call_reply_big_number(reply: *mut RedisModuleCallReply) -> Option<String>
268268
/// # Panics
269269
///
270270
/// Panics if the Redis server doesn't support replying with bool (since RESP3).
271-
#[allow(clippy::not_unsafe_ptr_arg_deref)]
271+
#[allow(clippy::not_unsafe_ptr_arg_deref, invalid_null_arguments)]
272272
pub fn call_reply_verbatim_string(reply: *mut RedisModuleCallReply) -> Option<(String, Vec<u8>)> {
273273
unsafe {
274274
let mut len: size_t = 0;

src/stream.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ pub struct StreamIterator<'key> {
1919

2020
impl<'key> StreamIterator<'key> {
2121
pub(crate) fn new(
22-
key: &RedisKey,
22+
key: &'key RedisKey,
2323
mut from: Option<raw::RedisModuleStreamID>,
2424
mut to: Option<raw::RedisModuleStreamID>,
2525
exclusive: bool,
2626
reverse: bool,
27-
) -> Result<StreamIterator, RedisError> {
27+
) -> Result<StreamIterator<'key>, RedisError> {
2828
let mut flags = if exclusive {
2929
raw::REDISMODULE_STREAM_ITERATOR_EXCLUSIVE as i32
3030
} else {

0 commit comments

Comments
 (0)