Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use CStr::from_bytes_until_nul to read rdkafka config #671

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
branches: [master]

env:
rust_version: 1.61.0
rust_version: 1.69.0

jobs:
lint:
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ keywords = ["kafka", "rdkafka"]
categories = ["api-bindings"]
edition = "2018"
exclude = ["Cargo.lock"]
rust-version = "1.61"
rust-version = "1.69"

[workspace]
members = ["rdkafka-sys"]
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ re-exported as rdkafka features.

### Minimum supported Rust version (MSRV)

The current minimum supported Rust version (MSRV) is 1.61.0. Note that
The current minimum supported Rust version (MSRV) is 1.69.0. Note that
bumping the MSRV is not considered a breaking change. Any release of
rust-rdkafka may bump the MSRV.

Expand Down
2 changes: 2 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ See also the [rdkafka-sys changelog](rdkafka-sys/changelog.md).

## Unreleased

* Bump MSRV to 1.69

## 0.36.2 (2024-01-16)

* Update `BaseConsumer::poll` to return `None` when handling rebalance
Expand Down
2 changes: 1 addition & 1 deletion rdkafka-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ description = "Native bindings to the librdkafka library"
keywords = ["kafka", "rdkafka"]
categories = ["external-ffi-bindings"]
edition = "2018"
rust-version = "1.61"
rust-version = "1.69"

[dependencies]
num_enum = "0.5.0"
Expand Down
5 changes: 4 additions & 1 deletion src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,10 @@ impl NativeClientConfig {
}

// Convert the C string to a Rust string.
Ok(String::from_utf8_lossy(&buf).to_string())
Ok(CStr::from_bytes_until_nul(&buf)
.expect("rd_kafka_conf_get to write a NUL-terminated string.")
.to_string_lossy()
.to_string())
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@
//!
//! ### Minimum supported Rust version (MSRV)
//!
//! The current minimum supported Rust version (MSRV) is 1.61.0. Note that
//! The current minimum supported Rust version (MSRV) is 1.69.0. Note that
//! bumping the MSRV is not considered a breaking change. Any release of
//! rust-rdkafka may bump the MSRV.
//!
Expand Down