Skip to content

Commit

Permalink
Update ndarray to 0.16.0, bump version to 0.11.0
Browse files Browse the repository at this point in the history
  • Loading branch information
minshao committed Aug 10, 2024
1 parent 4384c20 commit 6f63224
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 10 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ file is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and
this project adheres to [Semantic
Versioning](https://semver.org/spec/v2.0.0.html).

## [0.11.0] - 2024-08-09

### Changed

- Update ndarray to 0.16.

## [0.10.1] - 2023-05-23

### Fixed
Expand Down Expand Up @@ -132,6 +138,7 @@ Versioning](https://semver.org/spec/v2.0.0.html).

- Kafka input/output and an example of their usage.

[0.11.0]: https://github.com/petabi/eventio/compare/0.10.1...0.11.0
[0.10.1]: https://github.com/petabi/eventio/compare/0.10.0...0.10.1
[0.10.0]: https://github.com/petabi/eventio/compare/0.9.0...0.10.0
[0.9.0]: https://github.com/petabi/eventio/compare/0.8.0...0.9.0
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "eventio"
version = "0.10.1"
version = "0.11.0"
authors = ["Min Kim <[email protected]>", "Min Shao <[email protected]>"]
edition = "2021"
rust-version = "1.60"
Expand All @@ -24,7 +24,7 @@ pcap = ["pcap-parser"]
[dependencies]
crossbeam-channel = "0.5"
kafka = { version = "0.9", default-features = false, optional = true }
ndarray = { version = "0.15", optional = true }
ndarray = { version = "0.16", optional = true }
nom = "7"
pcap-parser = { version = "0.14", features = [
"data",
Expand Down
6 changes: 3 additions & 3 deletions src/kafka.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ impl super::Input for Input {
for msg in msgset.messages() {
let fwd_msg: ForwardMode = rmp_serde::from_slice(msg.value)
.map_err(|e| Error::InvalidMessage(Box::new(e)))?;
if fwd_msg.entries.len() > u32::max_value() as usize {
if fwd_msg.entries.len() > u32::MAX as usize {
return Err(Error::TooManyEvents(fwd_msg.entries.len()));
}
let (remaining, overflow) =
Expand All @@ -142,7 +142,7 @@ impl super::Input for Input {
loc: EntryLocation {
remainder: remainder
.try_into()
.expect("remainder <= u32::max_values()"),
.expect("remainder <= u32::MAX"),
partition,
offset,
},
Expand Down Expand Up @@ -243,7 +243,7 @@ where
/// Returns an error if message serialization or transmission fails.
pub fn run(&mut self) -> Result<(), kafka::Error> {
let mut buf = Vec::new();
for msg in self.data_channel.iter() {
for msg in &self.data_channel {
msg.serialize(&mut Serializer::new(&mut buf))
.map_err(|e| kafka::Error::Io(io::Error::new(io::ErrorKind::InvalidData, e)))?;
self.producer
Expand Down
8 changes: 3 additions & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,9 @@ impl fmt::Display for Error {
Self::CannotFetch(e) => write!(f, "cannot fetch message from Kafka: {e}"),
Self::InvalidMessage(e) => write!(f, "invalid MessagePack format: {e}"),
Self::Fatal(s) => write!(f, "fatal error: {s}"),
Self::TooManyEvents(n) => write!(
f,
"cannot handle {n} events (expected < {})",
u32::max_value()
),
Self::TooManyEvents(n) => {
write!(f, "cannot handle {n} events (expected < {})", u32::MAX)
}
}
}
}
3 changes: 3 additions & 0 deletions src/pcap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ pub struct Input {
unsafe impl Send for Input {}

impl Input {
/// # Panics
///
/// Will panic if fail to create reader
pub fn with_read<R: Read + 'static>(
data_channel: crossbeam_channel::Sender<Event>,
ack_channel: crossbeam_channel::Receiver<super::SeqNo>,
Expand Down

0 comments on commit 6f63224

Please sign in to comment.