This is an automated email from the ASF dual-hosted git repository. martinzink pushed a commit to branch minifi_rust_pgp in repository https://gitbox.apache.org/repos/asf/nifi-minifi-cpp.git
commit fce40dbef8fa70e490cf47e23fea4e1a6d90ce5d Author: Martin Zink <[email protected]> AuthorDate: Wed Aug 26 10:16:50 2026 +0200 review changes and clippy fix (for new rust warnings (rustc upgrade)) --- .../src/processors/generate_flow_file.rs | 9 ++++----- .../src/processors/put_file/unix_permissions.rs | 17 +++++++++++++++++ .../src/api/processor_wrappers/flow_file_transform.rs | 10 +++++----- 3 files changed, 26 insertions(+), 10 deletions(-) diff --git a/minifi_rust/extensions/minifi_rs_playground/src/processors/generate_flow_file.rs b/minifi_rust/extensions/minifi_rs_playground/src/processors/generate_flow_file.rs index 959ef7820..e4c426fd4 100644 --- a/minifi_rust/extensions/minifi_rs_playground/src/processors/generate_flow_file.rs +++ b/minifi_rust/extensions/minifi_rs_playground/src/processors/generate_flow_file.rs @@ -152,10 +152,9 @@ impl Trigger for GenerateFlowFileRs { PC: ProcessContext, PS: ProcessSession<FlowFile = PC::FlowFile>, { - let non_unique_data_buffer: &[u8]; let custom_text_for_batch: Option<String>; - if self.mode == Mode::CustomText { + let non_unique_data_buffer: &[u8] = if self.mode == Mode::CustomText { // CustomText mode must have the Custom Text property set at // trigger time — falling back to `data_generated_during_on_schedule` // (which is empty for this mode) would silently produce empty @@ -170,10 +169,10 @@ impl Trigger for GenerateFlowFileRs { ) })?, ); - non_unique_data_buffer = custom_text_for_batch.as_ref().unwrap().as_bytes(); + custom_text_for_batch.as_ref().unwrap().as_bytes() } else { - non_unique_data_buffer = self.data_generated_during_on_schedule.as_slice(); - } + self.data_generated_during_on_schedule.as_slice() + }; for _ in 0..self.batch_size { let ff = session.create()?; diff --git a/minifi_rust/extensions/minifi_rs_playground/src/processors/put_file/unix_permissions.rs b/minifi_rust/extensions/minifi_rs_playground/src/processors/put_file/unix_permissions.rs index be98676ae..8ded233d4 100644 --- a/minifi_rust/extensions/minifi_rs_playground/src/processors/put_file/unix_permissions.rs +++ b/minifi_rust/extensions/minifi_rs_playground/src/processors/put_file/unix_permissions.rs @@ -1,3 +1,20 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + use minifi_native::{MinifiError, PropertyConstraints, PropertySchema, PropertyType}; use std::path::Path; diff --git a/minifi_rust/minifi_native/src/api/processor_wrappers/flow_file_transform.rs b/minifi_rust/minifi_native/src/api/processor_wrappers/flow_file_transform.rs index ef2342b5b..9b1e650b5 100644 --- a/minifi_rust/minifi_native/src/api/processor_wrappers/flow_file_transform.rs +++ b/minifi_rust/minifi_native/src/api/processor_wrappers/flow_file_transform.rs @@ -220,7 +220,7 @@ macro_rules! unwrap_or_route { match $result { Ok(v) => v, Err(_e) => { - return Ok(TransformedFlowFile::route_without_changes($route)); + return Ok($crate::TransformedFlowFile::route_without_changes($route)); } } }; @@ -229,12 +229,12 @@ macro_rules! unwrap_or_route { match $result { Ok(v) => v, Err(e) => { - minifi_native::error!( + $crate::error!( $custom_logger, "Failed to unwrap due to {}. Routing flow file.", e ); - return Ok(TransformedFlowFile::route_without_changes($route)); + return Ok($crate::TransformedFlowFile::route_without_changes($route)); } } }; @@ -243,11 +243,11 @@ macro_rules! unwrap_or_route { match $result { Ok(v) => v, Err(e) => { - error!( + $crate::error!( $custom_logger, "Failed to {} due to {}. Routing flow file.", $context, e ); - return Ok(TransformedFlowFile::route_without_changes($route)); + return Ok($crate::TransformedFlowFile::route_without_changes($route)); } } };
