From fc561a981cf12236adc5cf5473bab8685c7764bf Mon Sep 17 00:00:00 2001 From: "Heinz N. Gies" Date: Sat, 19 Oct 2024 17:25:37 +0200 Subject: [PATCH] Update MSRV and make code more covered Signed-off-by: Heinz N. Gies --- Cargo.toml | 2 +- README.md | 14 +++++++------- src/system/flow_supervisor.rs | 5 ++--- tremor-codec/Cargo.toml | 2 +- tremor-interceptor/Cargo.toml | 2 +- tremor-interceptor/src/preprocessor/separate.rs | 4 +--- tremor-script-nif/Cargo.toml | 2 +- 7 files changed, 14 insertions(+), 17 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index ced7fdec57..122b0c06b5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,7 +10,7 @@ name = "tremor-runtime" readme = "README.md" repository = "https://github.com/tremor-rs/tremor-runtime" version = "0.13.0-rc.29" -rust-version = "1.62" +rust-version = "1.76" [workspace] diff --git a/README.md b/README.md index c2e7e2c803..368abd697f 100644 --- a/README.md +++ b/README.md @@ -100,13 +100,13 @@ Docker images are published to both [Docker Hub](https://hub.docker.com/r/tremor We publish our images with a set of different tags as explained below -| Image tags | Explanation | Example | -| ---------- | ----------------------------------- | --------- | -| `edge` | Tracking the `main` branch | | -| `latest` | The latest release | | +| Image tags | Explanation | Example | +| ---------- | ----------------------------------- | -------- | +| `edge` | Tracking the `main` branch | | +| `latest` | The latest release | | | `0.X.Y` | The exact release | `0.12.1` | -| `0.X` | The latest bugfix release for `0.X` | `0.12` | -| `0` | The latest minor release for `0` | `0` | +| `0.X` | The latest bugfix release for `0.X` | `0.12` | +| `0` | The latest minor release for `0` | `0` | ### Building the Docker Image @@ -158,7 +158,7 @@ docker exec -it fa7e3b4cec86 sh If you are not comfortable with managing library packages on your system or don't have experience with, please use the Docker image provided above. -For local builds, tremor requires rust 2021 (version `1.62` or later), along with all the tools needed to build rust programs. Eg: for CentOS, the packages `gcc`, `make`, `cmake`, `clang`, `openssl`, and `libstdc++` are required. For different distributions or operating systems, please install the packages accordingly. +For local builds, tremor requires rust 2021 (version `1.76` or later), along with all the tools needed to build rust programs. Eg: for CentOS, the packages `gcc`, `make`, `cmake`, `clang`, `openssl`, and `libstdc++` are required. For different distributions or operating systems, please install the packages accordingly. **NOTE** AVX2, SSE4.2 or NEON are needed to build [simd-json](https://github.com/simd-lite/simd-json#cpu-target) used by tremor. So if you are building in vm, check which processor instruction are passed to it. Like `lscpu | grep Flags` For a more detailed guide on local builds, please refer to the [tremor development docs](https://www.tremor.rs/community/development/quick-start). diff --git a/src/system/flow_supervisor.rs b/src/system/flow_supervisor.rs index b71adee9b0..57d2fd5145 100644 --- a/src/system/flow_supervisor.rs +++ b/src/system/flow_supervisor.rs @@ -188,9 +188,8 @@ impl FlowSupervisor { } task::spawn(async move { while alive_flows > 0 { - if let Some(Err(e)) = rx.recv().await { - error!("Error during Draining: {e}"); - }; + let res = rx.recv().await.and_then(Result::err); + res.inspect(|e| error!("Error during Draining: {e}")); alive_flows -= 1; } info!("Flows drained."); diff --git a/tremor-codec/Cargo.toml b/tremor-codec/Cargo.toml index dc02db707a..7a1383dfde 100644 --- a/tremor-codec/Cargo.toml +++ b/tremor-codec/Cargo.toml @@ -35,7 +35,7 @@ schema_registry_converter = { version = "4.2", default-features = false, feature "rustls_tls", "avro", "easy", -]} +] } # codecs reqwest = { version = "0.12", default-features = false, features = [ diff --git a/tremor-interceptor/Cargo.toml b/tremor-interceptor/Cargo.toml index 0ca3a65d11..544691d15b 100644 --- a/tremor-interceptor/Cargo.toml +++ b/tremor-interceptor/Cargo.toml @@ -8,7 +8,7 @@ homepage = "https://www.tremor.rs" license = "Apache-2.0" repository = "https://github.com/tremor-rs/tremor-runtime" version = "0.13.0-rc.29" -rust-version = "1.62" +rust-version = "1.76" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/tremor-interceptor/src/preprocessor/separate.rs b/tremor-interceptor/src/preprocessor/separate.rs index 81c7f7a731..35b31a6c2c 100644 --- a/tremor-interceptor/src/preprocessor/separate.rs +++ b/tremor-interceptor/src/preprocessor/separate.rs @@ -159,9 +159,7 @@ impl Separate { } fn exceeds_max_length(&self, len: usize) -> bool { - self.max_length - .map(|max| max.get() < len) - .unwrap_or_default() + self.max_length.is_some_and(|max| max.get() < len) } fn save_fragment(&mut self, v: &[u8]) -> Result<(), Error> { diff --git a/tremor-script-nif/Cargo.toml b/tremor-script-nif/Cargo.toml index 3cea964e4d..999c5c8e33 100644 --- a/tremor-script-nif/Cargo.toml +++ b/tremor-script-nif/Cargo.toml @@ -9,7 +9,7 @@ license = "Apache-2.0" readme = "README.md" repository = "https://github.com/tremor-rs/tremor-runtime" version = "0.13.0-rc.10" -rust-version = "1.62" +rust-version = "1.76" [lib] name = "tremor"